/* ==========================================================================
   Components - Shared UI components (glass overlay, peek blur, cards, etc.)
   ========================================================================== */

/* --- Font: AlimamaShuHeiTi --- */
@font-face {
    font-family: 'AlimamaShuHeiTi';
    src: url('/fonts/AlimamaShuHeiTi-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* --- Monospace Font Override --- */
.font-mono {
    font-family: AlimamaShuHeiTi, Courier New, monospace;
}

/* --- Peek Blur --- */
.peek-blur {
    border-radius: inherit;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    background: rgba(245, 247, 250, 0.97);
    justify-content: center;
    align-items: center;
    transition: opacity 0.35s;
    display: flex;
    position: absolute;
    inset: 0;
}

.peek-blur.active {
    opacity: 1;
}

.peek-blur-label {
    color: var(--muted-foreground);
    white-space: nowrap;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    display: flex;
}

/* --- Card Elevated --- */
.card-elevated {
    transition: box-shadow 0.2s, transform 0.2s;
    box-shadow: oklch(0.68 0.15 230 / 0.08) 0px 1px 3px, rgba(0, 0, 0, 0.04) 0px 1px 2px;
}

.card-elevated:hover {
    transform: translateY(-1px);
    box-shadow: oklch(0.68 0.15 230 / 0.12) 0px 4px 12px, rgba(0, 0, 0, 0.06) 0px 2px 4px;
}

/* --- Card Accent Top --- */
.card-accent-top {
    position: relative;
}

.card-accent-top::before {
    content: "";
    opacity: 0.6;
    background: linear-gradient(90deg, color(xyz-d65 0.264 0.326 0.77), color(xyz-d65 0.144 0.232 0.276), color(xyz-d65 0.264 0.326 0.77));
    border-radius: 999px 999px 0px 0px;
    height: 2px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

/* --- Table Row Styles --- */
.table-row-stripe:nth-child(2n) {
    background-color: var(--stripe-bg, oklch(0.68 0.15 230 / 0.03));
}

.table-row-hover {
    transition: background-color 0.15s;
}

.table-row-hover:hover {
    background-color: oklch(0.68 0.15 230 / 0.06);
}

/* --- Row Hit/Miss Indicators --- */
.row-hit {
    position: relative;
}

.row-hit::before {
    content: "";
    background: oklch(0.72 0.17 160);
    border-radius: 0px 2px 2px 0px;
    width: 3px;
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
}

.row-miss {
    position: relative;
}

.row-miss::before {
    content: "";
    background: oklch(0.577 0.245 27.325 / 0.6);
    border-radius: 0px 2px 2px 0px;
    width: 3px;
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
}

/* --- Button Lift --- */
.btn-lift {
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-lift:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-lift:active:not(:disabled) {
    transform: translateY(0px);
}

/* --- Scratch Canvas --- */
.scratch-canvas {
    position: absolute;
    z-index: 10;
    border-radius: 0.5rem;
    touch-action: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.scratch-canvas.active {
    opacity: 1;
    pointer-events: auto;
}

/* --- Settings Badge --- */
.setting-badge {
    background: var(--muted);
    color: var(--muted-foreground);
}

.setting-badge.on {
    background: oklch(0.72 0.17 160 / 0.15);
    color: oklch(0.55 0.17 160);
}

.dark .setting-badge.on {
    background: oklch(0.72 0.17 160 / 0.25);
    color: oklch(0.8 0.15 160);
}

/* --- Glass Overlay (咪牌 content cover) --- */
.glass-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 30;
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    background: oklch(0.98 0 0 / 0.6);
    border-radius: inherit;
    align-items: center;
    justify-content: center;
}

.dark .glass-overlay {
    background: oklch(0.15 0 0 / 0.7);
}

.glass-overlay.active {
    display: flex;
}

.glass-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--muted-foreground);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s, transform 0.3s;
}

.glass-overlay.active .glass-notice {
    opacity: 1;
    transform: translateY(0);
}

.glass-notice-icon {
    margin-bottom: 0.25rem;
    opacity: 0.6;
}

.glass-notice-sub {
    font-size: 0.7rem;
    opacity: 0.5;
}

/* --- Value Highlight --- */
.value-highlight {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

