:root {
    --page: #100b07;
    --page-deep: #090604;
    --surface: #1b120d;
    --surface-raised: #241811;
    --surface-hover: #302016;
    --text: #f8eee6;
    --text-muted: #b9a297;
    --text-faint: #806f64;
    --line: rgba(214, 161, 119, 0.18);
    --line-strong: rgba(242, 154, 74, 0.52);
    --accent: #f29a4a;
    --accent-strong: #ffc078;
    --warning: #f4bd65;
    --success: #8ad49a;
    --danger: #ef7f7f;
    --shadow: rgba(0, 0, 0, 0.36);
    --focus: #ffd08a;
    --grid-line: rgba(214, 161, 119, 0.055);
    --glow: rgba(242, 154, 74, 0.13);
    --accent-soft: rgba(242, 154, 74, 0.10);
    --accent-contrast: #1a0e05;
    --icon-accent: var(--accent);
    --card-surface: #241a14;
    --card-surface-hover: #332219;
    --card-text: #fff3e6;
    --card-description: #c7a88c;
    color-scheme: dark;
}

body.light-theme {
    --page: #f5f0e9;
    --page-deep: #ede5da;
    --surface: #fffaf4;
    --surface-raised: #fffdf9;
    --surface-hover: #fff3e6;
    --text: #2b211b;
    --text-muted: #74645a;
    --text-faint: #99877a;
    --line: rgba(125, 82, 48, 0.18);
    --line-strong: rgba(205, 111, 38, 0.55);
    --accent: #c96824;
    --accent-strong: #a94f16;
    --warning: #a76514;
    --success: #287f42;
    --danger: #bd4343;
    --shadow: rgba(82, 50, 29, 0.14);
    --focus: #98440f;
    --grid-line: rgba(145, 82, 39, 0.065);
    --glow: rgba(205, 111, 38, 0.13);
    --accent-soft: rgba(205, 111, 38, 0.10);
    --accent-contrast: #fffaf4;
    --icon-accent: var(--accent);
    --card-surface: #f0dfce;
    --card-surface-hover: #f5e5d5;
    --card-text: #3b2619;
    --card-description: #795944;
    color-scheme: light;
}

* { box-sizing: border-box; }

html {
    min-width: 320px;
    background: var(--page-deep);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background-color: var(--page);
    color: var(--text);
    font-family: 'Fira Sans', sans-serif;
    line-height: 1.5;
    transition: background-color 220ms ease, color 220ms ease;
}

.page-loader {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--page-deep);
    opacity: 1;
    transition: opacity 320ms ease, visibility 320ms ease;
}
.page-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}
.loader {
    position: relative;
    width: fit-content;
    max-width: calc(100vw - 40px);
    margin: 0;
    color: var(--text);
    font-family: 'Fira Code', monospace;
    font-size: clamp(2rem, 6vw, 3.125rem);
    font-style: italic;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
}
.loader span {
    display: block;
    animation: loader-cut 2s infinite;
    transition: color 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.loader:hover { color: var(--accent-strong); }
.loader::after,
.loader::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    border-radius: 4px;
    background: var(--accent);
    content: "";
    filter: opacity(0.9);
    transition: 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: loader-scan 2s infinite;
}
.loader::after {
    height: 6px;
    background: color-mix(in srgb, var(--accent) 58%, transparent);
    filter: blur(10px);
    z-index: 0;
}
.loader::before { z-index: 1; }
@keyframes loader-scan {
    0%, 50%, 100% { top: 0; }
    25%, 75% { top: calc(100% - 5px); }
}
@keyframes loader-cut {
    0%, 100% { clip-path: inset(0 0 100% 0); }
    25%, 50% { clip-path: inset(0 0 0 0); }
    75% { clip-path: inset(100% 0 0 0); }
}

button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}
::selection { background: var(--accent); color: var(--page-deep); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--page-deep); }
::-webkit-scrollbar-thumb {
    border: 3px solid var(--page-deep);
    border-radius: 999px;
    background: var(--text-faint);
}

.ambient-grid {
    position: fixed;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        radial-gradient(ellipse 58% 30% at 50% -8%, var(--glow), transparent 70%);
    background-size: 40px 40px, 40px 40px, 100% 100%;
    background-position: center top;
}

.container {
    position: relative;
    z-index: 1;
    width: min(1060px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 30px 0 12px;
}

.site-header {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 64px;
    border-bottom: 1px solid var(--line);
}

.brand-side {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}
.brand-side .github-info-ball {
    flex: 0 0 auto;
    color: var(--text);
}
.Btn {
    position: relative;
    display: flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: transform 300ms ease;
}
.svgContainer {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--text) 45%, transparent);
    border-radius: 10px;
    background: transparent;
    backdrop-filter: blur(0);
    font-size: 1.35rem;
    transition: background-color 300ms ease, backdrop-filter 300ms ease, border-color 300ms ease, box-shadow 300ms ease, color 300ms ease;
}
.svgContainer i {
    position: relative;
    z-index: 2;
    color: currentColor;
    filter: drop-shadow(0 1px 2px var(--shadow));
}
.Btn .BG {
    position: absolute;
    z-index: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    background: var(--surface-raised);
    pointer-events: none;
    transition: transform 300ms ease, background-color 300ms ease;
}
.Btn:hover .BG,
.Btn:focus-visible .BG {
    background: var(--accent);
    box-shadow: 0 0 14px var(--glow), 0 8px 18px -10px var(--accent);
    transform: rotate(35deg);
    transform-origin: bottom;
}
.Btn:hover .svgContainer,
.Btn:focus-visible .svgContainer {
    border-color: var(--line-strong);
    background: color-mix(in srgb, var(--accent) 78%, var(--surface-raised));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-contrast) 20%, transparent), 0 0 10px var(--glow);
    backdrop-filter: blur(4px);
    color: var(--accent-contrast);
}
body:not(.light-theme) .Btn .BG {
    box-shadow: inset 0 0 0 1px var(--line), 0 5px 14px -10px var(--shadow);
}
body:not(.light-theme) .Btn:hover .BG,
body:not(.light-theme) .Btn:focus-visible .BG {
    box-shadow: 0 0 0 1px var(--line-strong), 0 0 18px color-mix(in srgb, var(--accent) 55%, transparent), 0 10px 24px -12px var(--accent);
}
body:not(.light-theme) .Btn:hover .svgContainer,
body:not(.light-theme) .Btn:focus-visible .svgContainer {
    background: color-mix(in srgb, var(--accent) 86%, var(--surface-raised));
}
.Btn:active { transform: scale(0.95); }
.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--text) 50%, transparent);
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: color-mix(in srgb, var(--text) 58%, transparent);
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    text-shadow: none;
    user-select: none;
    transition: 500ms ease;
}
.brand:hover .brand-mark,
.brand:focus-visible .brand-mark {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 5px var(--accent), 0 0 20px var(--accent), 0 0 50px var(--glow), 0 0 80px var(--glow);
    color: var(--accent-contrast);
    text-shadow: 0 0 5px color-mix(in srgb, var(--accent-contrast) 80%, transparent), 0 0 10px color-mix(in srgb, var(--accent-contrast) 55%, transparent);
}

.brand-copy { display: grid; gap: 1px; min-width: 0; }
.brand-copy strong {
    font-family: 'Fira Code', monospace;
    font-size: 1.52rem;
    font-weight: 700;
    line-height: 44px;
}
.section-index, .entry-count, .search-shortcut, .site-footer {
    color: var(--text-faint);
    font-family: 'Fira Code', monospace;
    font-size: 0.67rem;
}

.tool-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}
.tool-dock {
    display: grid;
    grid-template-columns: repeat(2, 46px);
    gap: 4px;
    padding: 6px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    box-shadow: none;
    transform: perspective(700px) rotateX(0deg);
    transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.tool-dock:hover {
    border-color: transparent;
    background: transparent;
    transform: none;
}
.tool-dock .tool-button,
.tool-dock .palette-control > .tool-button {
    width: 46px;
    height: 46px;
    border: 0;
    background: var(--surface-raised);
    box-shadow: 0 2px 5px -1px var(--shadow);
    font-size: 1.05rem;
}
.tool-dock > .tool-button:nth-child(1) { border-radius: 46px 7px 7px 7px; }
.tool-dock > .tool-button:nth-child(2) { border-radius: 7px 46px 7px 7px; }
.tool-dock > .palette-control > .tool-button { border-radius: 7px 7px 7px 46px; }
.tool-dock > .history-page { border-radius: 7px 7px 46px 7px; }
.tool-dock > .tool-button:nth-child(1)[data-tip]::after,
.tool-dock > .tool-button:nth-child(2)[data-tip]::after {
    top: auto;
    bottom: calc(100% + 9px);
    z-index: 60;
}
.tool-dock .tool-button:hover,
.tool-dock .tool-button:focus-visible,
.tool-dock .palette-control > .tool-button[aria-expanded="true"] {
    border-color: transparent;
    background: var(--accent);
    color: var(--accent-contrast);
    box-shadow: 0 0 12px var(--glow);
    transform: scale(1.08);
}

.tool-button {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: transform 160ms ease, color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
.tool-button:hover {
    border-color: var(--line);
    background: var(--surface);
    color: var(--accent-strong);
    transform: translateY(-1px);
}
.tool-button:active { transform: translateY(1px); }
.latest-page { display: none; }

.tool-button[data-tip], .Btn[data-tip], .theme-control[data-tip] { position: relative; }
.tool-button[data-tip]::after, .Btn[data-tip]::after, .theme-control[data-tip]::after {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 50%;
    width: max-content;
    max-width: 180px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-raised);
    color: var(--text-muted);
    content: attr(data-tip);
    font-family: 'Fira Code', monospace;
    font-size: 0.62rem;
    line-height: 1.3;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -3px);
    transition: opacity 150ms ease, transform 150ms ease;
    visibility: hidden;
}
.tool-button[data-tip]:hover::after, .tool-button[data-tip]:focus-visible::after,
.Btn[data-tip]:hover::after, .Btn[data-tip]:focus-visible::after,
.theme-control[data-tip]:focus-within::after, .theme-control[data-tip]:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
    visibility: visible;
}

.theme-control { display: inline-flex; align-items: center; }
.theme-control .theme-switch {
    --theme-transition: .5s cubic-bezier(0, -0.02, 0.4, 1.25);
    position: relative;
    display: block;
    width: 86px;
    height: 48px;
    overflow: visible;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    transform: none;
    transition: filter 180ms ease;
}
.theme-control .theme-switch:hover { border-color: transparent; transform: translateY(-1px); filter: brightness(1.08); }
.theme-control .theme-switch__container {
    position: relative;
    display: block;
    width: 86px;
    height: 48px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #1d1f2c;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.24), 0 8px 20px -15px var(--shadow);
    transition: background-color var(--theme-transition), box-shadow var(--theme-transition);
}
.theme-switch__container::before {
    position: absolute;
    z-index: 1;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.22);
    content: "";
    pointer-events: none;
}
.theme-switch__clouds {
    position: absolute;
    bottom: -52px;
    left: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f3fdff;
    box-shadow: 16px 5px 0 #f3fdff, 30px 1px 0 #aacadf, 45px 6px 0 #f3fdff, 59px 1px 0 #aacadf;
    transition: transform var(--theme-transition), bottom var(--theme-transition);
}
.theme-switch__stars-container {
    position: absolute;
    z-index: 1;
    top: 6px;
    right: 7px;
    width: 42px;
    height: 20px;
    opacity: 1;
    background-image: radial-gradient(circle, #fff 0 1.5px, transparent 2px), radial-gradient(circle, #fff 0 1px, transparent 1.5px);
    background-position: 3px 4px, 24px 12px;
    background-size: 20px 14px, 18px 12px;
    transition: opacity var(--theme-transition), transform var(--theme-transition);
}
.theme-switch__circle-container {
    position: absolute;
    z-index: 2;
    top: -7px;
    left: 31px;
    display: flex;
    width: 62px;
    height: 62px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.08), inset 0 0 0 10px rgba(255, 255, 255, 0.08);
    pointer-events: none;
    transition: left var(--theme-transition);
}
.theme-switch__sun-moon-container {
    width: 38px;
    height: 38px;
    overflow: hidden;
    border-radius: 50%;
    background: #f6d365;
    box-shadow: inset 2px 2px 2px rgba(255, 255, 230, 0.62), inset 0 -2px 2px rgba(120, 80, 20, 0.38), 2px 4px 6px rgba(0, 0, 0, 0.24);
    transition: background-color var(--theme-transition);
}
.theme-switch__moon {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #c4c9d1;
    transform: translateX(0);
    transition: transform var(--theme-transition);
}
.theme-switch__spot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #959db1;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.24);
}
.theme-switch__spot:nth-child(1) { top: 9px; left: 6px; }
.theme-switch__spot:nth-child(2) { top: 20px; left: 22px; width: 5px; height: 5px; }
.theme-switch__spot:nth-child(3) { top: 6px; left: 25px; width: 4px; height: 4px; }
.theme-toggle:checked + .theme-switch__container { background: #5d88a8; }
.theme-toggle:checked + .theme-switch__container .theme-switch__circle-container { left: -7px; }
.theme-toggle:checked + .theme-switch__container .theme-switch__moon { transform: translateX(100%); }
.theme-toggle:checked + .theme-switch__container .theme-switch__clouds { bottom: -14px; transform: translateX(0); }
.theme-toggle:checked + .theme-switch__container .theme-switch__stars-container { opacity: 0; transform: translateY(-4px); }
.theme-toggle:focus-visible + .theme-switch__container { outline: 2px solid var(--focus); outline-offset: 4px; }
.palette-control { position: relative; display: inline-flex; }
.palette-control > .tool-button[aria-expanded="true"] {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--accent-strong);
}
.palette-items {
    position: absolute;
    z-index: 40;
    top: calc(100% + 12px);
    right: 0;
    display: flex;
    min-width: max-content;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-raised);
    box-shadow: 0 14px 36px var(--shadow);
    pointer-events: auto;
    transform: perspective(1000px);
    transform-style: preserve-3d;
}
.palette-items[hidden] { display: none; }
.palette-item {
    position: relative;
    width: 28px;
    height: 36px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    cursor: pointer;
    transition: 500ms cubic-bezier(0.175, 0.885, 0.32, 1.1);
}
.palette-item::after {
    position: absolute;
    inset: 2px 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    background: var(--palette-color);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
    content: "";
    pointer-events: none;
    transform: scale(1.12);
    transition: 500ms cubic-bezier(0.175, 0.885, 0.32, 1.1);
}
.palette-item::before {
    position: absolute;
    z-index: 2;
    bottom: 48px;
    left: 50%;
    width: max-content;
    padding: 3px 5px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-raised);
    color: var(--text);
    content: attr(data-color-label);
    font-family: 'Fira Code', monospace;
    font-size: 0.55rem;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 180ms ease, visibility 180ms ease;
    visibility: hidden;
}
.palette-item:hover,
.palette-item:focus-visible {
    z-index: 5;
    transform: scale(1.5);
}
.palette-item:hover::before,
.palette-item:focus-visible::before { opacity: 1; visibility: visible; }
.palette-item:active::after { transform: scale(1.02); }
.palette-item[aria-selected="true"]::after {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}
.palette-item:hover + .palette-item,
.palette-item:focus-visible + .palette-item,
.palette-item:has(+ .palette-item:hover),
.palette-item:has(+ .palette-item:focus-visible) {
    z-index: 4;
    transform: scale(1.3);
}
.palette-item:hover + .palette-item + .palette-item,
.palette-item:focus-visible + .palette-item + .palette-item,
.palette-item:has(+ .palette-item + .palette-item:hover),
.palette-item:has(+ .palette-item + .palette-item:focus-visible) {
    z-index: 3;
    transform: scale(1.15);
}
.theme-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.announcement-wrap {
    position: relative;
    z-index: 25;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
}
.announcement-wrap[hidden] { display: none; }
.announcement-button {
    position: relative;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--icon-accent);
    cursor: pointer;
    overflow: hidden;
    box-shadow: none;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.announcement-button::before {
    position: absolute;
    inset: -24px;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 68%);
    content: "";
    filter: blur(10px);
    opacity: 0.72;
    transition: opacity 180ms ease;
}
.announcement-button-content {
    position: relative;
    display: inline-grid;
    place-items: center;
    color: currentColor;
    font-size: 0.95rem;
    line-height: 1;
}
.announcement-button-content i { color: currentColor; }
.announcement-button:hover,
.announcement-button:focus-visible,
.announcement-wrap:focus-within .announcement-button {
    border-color: var(--line);
    background: var(--surface);
    box-shadow: 0 0 12px var(--glow);
    transform: translateY(-1px);
}
.announcement-button:hover::before,
.announcement-button:focus-visible::before { opacity: 1; }
.announcement-details {
    position: absolute;
    z-index: 20;
    top: 50%;
    right: calc(100% + 12px);
    bottom: auto;
    left: auto;
    width: min(288px, calc(100vw - 32px));
    padding: 1px;
    border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-raised) 94%, var(--accent));
    box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 16%, transparent), 0 16px 35px var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translate(8px, -50%);
    transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
    visibility: hidden;
}
.announcement-wrap:hover .announcement-details,
.announcement-wrap:focus-within .announcement-details,
.announcement-details.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, -50%);
    visibility: visible;
}
.announcement-details-inner {
    position: relative;
    padding: 13px 14px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--surface-raised) 96%, transparent);
}
.announcement-details-inner::after {
    position: absolute;
    top: calc(50% - 6px);
    right: -7px;
    width: 12px;
    height: 12px;
    border-top: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
    border-right: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
    background: var(--surface-raised);
    content: "";
    transform: rotate(45deg);
}
.announcement-details-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 9px;
}
.announcement-details-icon {
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--icon-accent);
}
.announcement-details h2 {
    margin: 0;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 700;
}
.announcement-details p {
    margin: 0 0 9px;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.announcement-date {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-faint);
    font-family: 'Fira Code', monospace;
    font-size: 0.62rem;
}
.announcement-date i { color: var(--icon-accent); }

.search-section {
    display: flex;
    justify-content: center;
    padding: 28px 0 20px;
}
.search-box {
    display: flex;
    width: min(100%, 560px);
    min-height: 48px;
    align-items: center;
    gap: 8px;
    padding: 6px 7px 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 12px 30px -24px var(--shadow);
    transition: border-color 180ms ease, background-color 180ms ease;
}
.search-box:focus-within { border-color: var(--line-strong); background: var(--surface-raised); }
.search-mode-toggle, .search-button {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 150ms ease, background-color 150ms ease, transform 150ms ease;
}
.search-mode-toggle:hover, .search-button:hover { background: var(--accent-soft); color: var(--accent-strong); }
.search-mode-toggle:active, .search-button:active { transform: translateY(1px); }
.search-box input[type="search"] {
    width: 100%;
    min-width: 0;
    padding: 8px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 0.92rem;
}
.search-box input[type="search"]::placeholder { color: var(--text-faint); }
.search-shortcut { flex: 0 0 auto; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; }

.main-content {
    padding: 10px 0 24px;
    overflow: visible;
    max-height: var(--cards-expanded-height, 2400px);
    opacity: 1;
    transition: max-height 280ms ease, opacity 180ms ease, padding 280ms ease;
}
.main-content.cards-collapsed {
    overflow: hidden;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
}
.panel-header h2 {
    margin: 0;
    color: var(--text);
    font-family: 'Fira Code', monospace;
    font-size: 1.25rem;
}
.card-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 6px 8px;
}
.card {
    position: relative;
    z-index: 0;
    height: 92px;
    min-width: 0;
    transition: transform 200ms ease, z-index 0s linear 200ms;
}
.card:hover,
.card:focus-within {
    z-index: 2;
    transform: scale(1.04);
    transition-delay: 0s;
}
.card-surface {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: var(--card-surface);
    color: var(--card-text);
    text-decoration: none;
    transform: translateZ(0);
    transform-style: preserve-3d;
    transition: background-color 200ms ease, transform 200ms ease;
}
.card:hover .card-surface,
.card:focus-within .card-surface {
    background: var(--card-surface-hover);
}
.card-icon-wrap {
    position: absolute;
    z-index: 1;
    display: grid;
    width: 44%;
    height: 60%;
    place-items: center;
    color: var(--card-text);
    font-size: 1.68rem;
    line-height: 1;
    transform: translateZ(0);
    transition: filter 200ms ease, transform 200ms ease;
}
.card-icon-wrap .card-icon { width: 1.38em; height: 1.38em; object-fit: contain; }
.card-icon-wrap > span { font-size: 1.4em; }
.card-textbox {
    position: absolute;
    z-index: 5;
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0;
    padding: 1em;
    color: var(--card-text);
    opacity: 0;
    pointer-events: none;
    transform: translateZ(12px);
    transition: opacity 200ms ease, gap 200ms ease;
}
.card-title-lower,
.card-title {
    display: block;
    overflow: hidden;
    font-family: 'Fira Sans', sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-title-lower {
    position: absolute;
    z-index: 4;
    right: 10px;
    bottom: 8px;
    left: 10px;
    width: calc(100% - 20px);
    color: var(--card-text);
    font-size: 0.78em;
    font-weight: 600;
    line-height: 1.15;
    opacity: 0;
    text-align: center;
    transform: translateY(4px);
    transition: opacity 180ms ease, transform 180ms ease;
}
.card-title {
    width: 100%;
    color: var(--card-text);
    font-size: 1em;
    font-weight: 700;
    line-height: 1.15;
    opacity: 1;
    text-align: left;
}
.card-description {
    display: block;
    width: 100%;
    max-height: 2.4em;
    overflow: hidden;
    color: var(--card-description);
    font-family: 'Fira Sans', sans-serif;
    font-size: 0.8em;
    font-weight: 300;
    line-height: 1.2;
    opacity: 0;
    text-align: left;
    text-overflow: ellipsis;
}
.card:hover .card-textbox,
.card:focus-within .card-textbox {
    gap: 0.5em;
    opacity: 1;
}
.card:hover .card-title-lower,
.card:focus-within .card-title-lower {
    opacity: 0;
    transform: translateY(4px);
}
.card:hover .card-description,
.card:focus-within .card-description {
    opacity: 1;
}
.card:hover .card-icon-wrap,
.card:focus-within .card-icon-wrap {
    animation: card-icon-float 3s infinite ease-in-out;
    filter: blur(3px);
}
@keyframes card-icon-float {
    50% { transform: translateY(-10%) rotate(5deg); }
}
.show-card-titles .card-title-lower {
    opacity: 1;
    transform: translateY(0);
}
.show-card-titles .card-textbox {
    gap: 0;
    opacity: 0;
}
.show-card-titles .card-description { opacity: 0; }
.show-card-titles .card:hover .card-textbox,
.show-card-titles .card:focus-within .card-textbox { gap: 0.5em; }
.show-card-titles .card:hover .card-description,
.show-card-titles .card:focus-within .card-description { opacity: 1; }
.card-status, .panel-status { margin: 16px 0 0; color: var(--text-faint); font-family: 'Fira Code', monospace; font-size: 0.72rem; }
.card-status.is-error, .panel-status.is-error { color: var(--danger); }
.card-status:empty, .panel-status:empty { display: none; }
.github-status-loader { min-height: 190px; }
.ai-matrix-loader {
    position: relative;
    display: grid;
    width: 120px;
    height: 160px;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin: 30px auto 0;
    perspective: 800px;
}
.ai-matrix-loader .digit {
    color: var(--accent);
    font-family: 'Fira Code', monospace;
    font-size: 18px;
    opacity: 0;
    text-align: center;
    text-shadow: 0 0 5px var(--accent);
    animation: matrix-fall 2s infinite, matrix-flicker 0.5s infinite;
}
.ai-matrix-loader .digit:nth-child(1) { animation-delay: 0.1s; }
.ai-matrix-loader .digit:nth-child(2) { animation-delay: 0.3s; }
.ai-matrix-loader .digit:nth-child(3) { animation-delay: 0.5s; }
.ai-matrix-loader .digit:nth-child(4) { animation-delay: 0.7s; }
.ai-matrix-loader .digit:nth-child(5) { animation-delay: 0.9s; }
.ai-matrix-loader .digit:nth-child(6) { animation-delay: 1.1s; }
.ai-matrix-loader .digit:nth-child(7) { animation-delay: 1.3s; }
.ai-matrix-loader .digit:nth-child(8) { animation-delay: 1.5s; }
.ai-matrix-loader .glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 70%);
    pointer-events: none;
    animation: matrix-pulse 2s infinite;
}
@keyframes matrix-fall {
    0% { opacity: 0; transform: translateY(-50px) rotateX(90deg); }
    20%, 80% { opacity: 0.8; transform: translateY(0) rotateX(0deg); }
    100% { opacity: 0; transform: translateY(50px) rotateX(-90deg); }
}
@keyframes matrix-flicker {
    0%, 19%, 21%, 100% { opacity: 0.8; }
    20% { opacity: 0.2; }
}
@keyframes matrix-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}
.highlight { outline: 2px solid var(--accent); outline-offset: 3px; }

.emotion-ball-area {
    position: relative;
    display: grid;
    width: 100%;
    min-height: clamp(420px, 62vw, 720px);
    grid-template-rows: minmax(360px, 1fr) auto;
    place-items: center;
    overflow: hidden;
    margin-top: 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.emotion-ball-visual {
    position: relative;
    display: grid;
    width: min(72%, 650px);
    aspect-ratio: 1;
    place-items: center;
}

.emotion-ball {
    width: 100%;
    height: 100%;
    opacity: 0.92;
    cursor: pointer;
}

.emotion-error-notice {
    position: absolute;
    z-index: 5;
    top: 2%;
    left: 1%;
    width: min(260px, 46%);
    padding: 8px 10px;
    border: 1px solid rgba(239, 127, 127, 0.68);
    border-radius: 7px;
    background: rgba(82, 28, 28, 0.84);
    box-shadow: 0 8px 20px var(--shadow);
    color: #ffd7d7;
    font-size: 0.72rem;
    line-height: 1.4;
    opacity: 0;
    overflow-wrap: anywhere;
    pointer-events: none;
    transform: translateY(-5px);
    transition: opacity 220ms ease, transform 220ms ease;
}
.emotion-error-notice.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.emotion-reply-bubbles {
    position: absolute;
    z-index: 3;
    inset: 0;
    pointer-events: none;
}

.emotion-reply-bubble {
    position: absolute;
    width: min(220px, 40%);
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--bubble-border, var(--line-strong));
    border-radius: var(--bubble-radius, 12px);
    background: var(--bubble-bg, var(--surface-raised));
    box-shadow: 0 10px 24px var(--shadow);
    color: var(--bubble-text, var(--text));
    font-size: 0.76rem;
    line-height: 1.45;
    opacity: 0;
    overflow-wrap: anywhere;
    pointer-events: none;
    transform: translateY(7px) scale(0.97);
    transition: opacity 220ms ease, transform 220ms ease;
}

.emotion-reply-bubble::after {
    position: absolute;
    width: 9px;
    height: 9px;
    border-right: 1px solid var(--bubble-border, var(--line-strong));
    border-bottom: 1px solid var(--bubble-border, var(--line-strong));
    background: var(--bubble-bg, var(--surface-raised));
    content: "";
    transform: rotate(45deg);
}

.emotion-reply-bubble.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.emotion-reply-bubble.position-left-top { top: 11%; left: 1%; }
.emotion-reply-bubble.position-left-mid { top: 36%; left: -4%; }
.emotion-reply-bubble.position-right-top { top: 11%; right: 1%; }
.emotion-reply-bubble.position-right-mid { top: 36%; right: -4%; }
.emotion-reply-bubble.position-left-top::after,
.emotion-reply-bubble.position-left-mid::after { right: -5px; top: 18px; }
.emotion-reply-bubble.position-right-top::after,
.emotion-reply-bubble.position-right-mid::after { left: -5px; top: 18px; }

.emotion-reply-bubble.shape-soft { --bubble-radius: 13px; }
.emotion-reply-bubble.shape-pill { --bubble-radius: 999px; padding-inline: 15px; }
.emotion-reply-bubble.shape-angular { --bubble-radius: 3px 13px 3px 13px; }
.emotion-reply-bubble.tone-orange { --bubble-bg: color-mix(in srgb, var(--accent) 14%, transparent); --bubble-border: color-mix(in srgb, var(--accent) 58%, transparent); }
.emotion-reply-bubble.tone-green { --bubble-bg: rgba(105, 217, 154, 0.14); --bubble-border: rgba(105, 217, 154, 0.62); }
.emotion-reply-bubble.tone-violet { --bubble-bg: rgba(174, 139, 225, 0.16); --bubble-border: rgba(174, 139, 225, 0.58); }
.emotion-reply-bubble.tone-amber { --bubble-bg: rgba(244, 189, 101, 0.16); --bubble-border: rgba(244, 189, 101, 0.62); }
.emotion-reply-bubble.is-error { --bubble-bg: rgba(239, 127, 127, 0.14); --bubble-border: rgba(239, 127, 127, 0.64); }

.emotion-ball:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 4px;
}

.emotion-ball svg {
    overflow: visible;
}

.emotion-chat-form {
    z-index: 4;
    display: flex;
    width: min(560px, calc(100% - 32px));
    min-height: 44px;
    align-items: center;
    gap: 8px;
    padding: 5px 6px 5px 6px;
    margin: 0 0 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    transition: border-color 180ms ease, background-color 180ms ease;
}

.emotion-chat-form:focus-within {
    border-color: var(--line-strong);
    background: var(--surface-raised);
}

.emotion-chat-form input {
    width: 100%;
    min-width: 0;
    padding: 7px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 0.84rem;
}

.emotion-chat-form input::placeholder { color: var(--text-faint); }

.emotion-chat-form button {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.emotion-chat-form button:hover,
.emotion-chat-form button:focus-visible {
    border-color: var(--line);
    background: var(--surface-hover);
    color: var(--accent-strong);
}

.emotion-chat-form button:active { transform: translateY(1px); }
.emotion-chat-form button:disabled { cursor: wait; opacity: 0.45; }
.emotion-chat-form .emotion-model-toggle {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #fb923c;
    cursor: pointer;
    transition: transform 160ms ease, color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
.emotion-model-toggle i { font-size: 0.92rem; }
.emotion-chat-form .emotion-model-toggle[aria-pressed="true"] { color: #3b82f6; }
.emotion-chat-form .emotion-model-toggle:hover,
.emotion-chat-form .emotion-model-toggle:focus-visible {
    border-color: var(--line);
    background: var(--surface);
    transform: translateY(-1px);
}
.emotion-chat-form .emotion-model-toggle:active { transform: translateY(1px); }

.emotion-settings-button {
    position: absolute;
    z-index: 4;
    top: 12px;
    right: 12px;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: transform 160ms ease, color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.emotion-settings-button:hover {
    border-color: var(--line);
    background: var(--surface);
    color: var(--accent-strong);
    transform: translateY(-1px);
}

.emotion-settings-button:active {
    transform: translateY(1px);
}

.emotion-settings {
    position: absolute;
    z-index: 5;
    top: 56px;
    right: 12px;
    width: min(236px, calc(100% - 20px));
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-raised);
    box-shadow: 0 14px 38px var(--shadow);
}

.emotion-settings[hidden] {
    display: none;
}

.emotion-settings-header,
.emotion-setting-row,
.emotion-slider-row > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.emotion-settings-header {
    margin-bottom: 8px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
}

.emotion-settings-header strong {
    font-size: 0.82rem;
}

.emotion-setting-row {
    min-height: 32px;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.emotion-select-row { min-height: 36px; }

.emotion-select {
    width: 132px;
    min-width: 0;
    padding: 6px 27px 6px 9px;
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: 0;
    background-color: var(--surface);
    background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
    background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
    background-repeat: no-repeat;
    background-size: 4px 4px, 4px 4px;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.emotion-select:hover,
.emotion-select:focus-visible {
    border-color: var(--line-strong);
    background-color: var(--surface-hover);
}

.emotion-switch {
    position: relative;
    width: 34px;
    height: 18px;
    flex: 0 0 auto;
    margin: 0;
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    outline: 0;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.emotion-switch::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-faint);
    content: "";
    transition: transform 160ms ease, background-color 160ms ease;
}

.emotion-switch:checked {
    border-color: #55c98a;
    background: rgba(54, 178, 112, 0.24);
}

.emotion-switch:checked::after {
    background: #69d99a;
    transform: translateX(16px);
}

.emotion-switch:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.emotion-slider-row {
    display: grid;
    gap: 5px;
    min-height: 43px;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.emotion-slider-row output {
    min-width: 28px;
    color: var(--accent-strong);
    font-family: 'Fira Code', monospace;
    font-size: 0.68rem;
    text-align: right;
}

.emotion-slider-row input[type="range"] {
    width: 100%;
    height: 4px;
    margin: 0;
    appearance: none;
    border-radius: 999px;
    outline: 0;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--range-progress, 30%), var(--line) var(--range-progress, 30%), var(--line) 100%);
    cursor: pointer;
}

.emotion-slider-row input[type="range"]::-webkit-slider-thumb {
    width: 13px;
    height: 13px;
    appearance: none;
    border: 2px solid var(--surface-raised);
    border-radius: 50%;
    background: var(--accent-strong);
    box-shadow: 0 0 0 1px var(--accent);
}

.emotion-slider-row input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border: 2px solid var(--surface-raised);
    border-radius: 50%;
    background: var(--accent-strong);
    box-shadow: 0 0 0 1px var(--accent);
}

.emotion-slider-row input[type="range"]:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 4px;
}

.emotion-settings.is-busy { pointer-events: none; opacity: 0.7; }

.panel-backdrop { position: fixed; z-index: 80; inset: 0; background: rgba(2, 6, 9, 0.64); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
.panel-backdrop.active { opacity: 1; pointer-events: auto; }
.github-info-panel {
    position: fixed;
    z-index: 90;
    top: 0;
    left: 0;
    width: min(400px, 100%);
    height: 100dvh;
    overflow-y: auto;
    padding: 24px;
    border-right: 1px solid var(--line);
    background: var(--surface-raised);
    box-shadow: 18px 0 45px var(--shadow);
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 180ms ease, transform 240ms cubic-bezier(.2, .8, .2, 1);
    visibility: hidden;
}
.github-info-panel.active { opacity: 1; transform: translateX(0); visibility: visible; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.github-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}
.github-profile a {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}
.github-profile img {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
}
.github-identity { min-width: 0; }
.github-profile h2 {
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.github-stats {
    display: grid;
    flex: 0 0 auto;
    gap: 6px;
    color: var(--text-muted);
    font-family: 'Fira Code', monospace;
    font-size: 0.62rem;
    text-align: right;
}
.github-stat {
    min-width: 82px;
    white-space: nowrap;
}
.github-stat i {
    display: inline-block;
    width: 1.35em;
    margin-right: 7px;
    color: var(--accent-strong);
    text-align: center;
}
.github-stat-number {
    color: var(--accent-strong);
    font-size: 1.08em;
    font-weight: 700;
}
.github-info { color: var(--text-muted); }
.github-info h4 { margin: 16px 0; font-weight: 400; }
.github-repos h3 {
    margin: 24px 0 10px;
    color: var(--text-faint);
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    font-weight: 400;
    text-transform: uppercase;
}
.github-repos ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.github-repos li {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.github-repos li::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--accent);
    content: "";
    opacity: 0.65;
    transition: width 180ms ease, opacity 180ms ease;
}
.github-repos li:hover,
.github-repos li:focus-within {
    border-color: var(--line-strong);
    background: var(--surface-hover);
    box-shadow: 0 8px 22px -16px var(--accent);
    transform: translateY(-2px);
}
.github-repos li:hover::before,
.github-repos li:focus-within::before { width: 5px; opacity: 1; }
.github-repos li a {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 12px 13px 7px 15px;
    color: var(--text);
    text-decoration: none;
}
.github-repos li a i { color: var(--accent-strong); transition: transform 180ms ease; }
.github-repos li:hover a i,
.github-repos li:focus-within a i { transform: translateX(2px); }
.github-repos li a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.github-repos .repo-date {
    padding: 0 13px 10px 15px;
    color: var(--text-faint);
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    text-align: right;
}
.view-more-button { width: 100%; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--text-muted); cursor: pointer; }
.view-more-button:hover { border-color: var(--line-strong); color: var(--accent-strong); }
.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1px;
    width: 100%;
    margin-top: 28px;
    padding: 18px 0 18px;
    border-top: 1px solid var(--line);
}
.beian-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-faint);
    font-family: 'Fira Code', monospace;
    font-size: 0.62rem;
    line-height: 1.4;
    text-decoration: none;
    transition: color 180ms ease, text-shadow 180ms ease;
}
.beian-link i { color: var(--icon-accent); font-size: 0.7rem; }
.beian-link:hover,
.beian-link:focus-visible {
    color: var(--accent-strong);
    text-shadow: 0 0 12px var(--glow);
}
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.page-reveal { animation: page-reveal 360ms both; }
.hero.page-reveal { animation-delay: 50ms; }
.main-content.page-reveal { animation-delay: 100ms; }
.site-footer.page-reveal { animation-delay: 140ms; }
@keyframes page-reveal { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

.white-black, .w-d-button { color: var(--text); }
.grey { color: #b5aa90; }
.red { color: #ed6b4b; }
.pink { color: #ed93b0; }
.green { color: var(--success); }
.green-L { color: #69ca80; }
.blue { color: #4fc3df; }
.yellow { color: #f1cf62; }
.orange { color: var(--icon-accent); }
.purple { color: #aa8bd0; }
body.light-theme .grey { color: #766a55; }
body.light-theme .red { color: #c44525; }
body.light-theme .pink { color: #ba5174; }
body.light-theme .green-L { color: #2d873f; }
body.light-theme .blue { color: #147b9c; }
body.light-theme .yellow { color: #9a6814; }
body.light-theme .orange { color: var(--icon-accent); }
body.light-theme .purple { color: #76519a; }

@media (max-width: 900px) {
    .card-container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 660px) {
    .container { width: min(100% - 28px, 1180px); padding-top: 24px; }
    .site-header {
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
        padding-bottom: 14px;
    }
    .brand-side {
        flex: 1 1 100%;
        gap: 5px;
    }
    .brand-side .brand { flex: 0 0 auto; }
    .brand-side .github-info-ball { width: 40px; height: 44px; }
    .brand-copy small { display: none; }
    .tool-bar {
        width: 100%;
        min-width: 0;
        max-width: none;
        flex: 1 0 100%;
        justify-content: flex-end;
        gap: 8px;
    }
    .tool-dock { grid-template-columns: repeat(2, 40px); gap: 3px; padding: 5px; }
    .tool-dock .tool-button,
    .tool-dock .palette-control > .tool-button { width: 40px; height: 40px; }
    .theme-control .theme-switch,
    .theme-control .theme-switch__container { width: 76px; height: 44px; }
    .theme-control .theme-switch__circle-container { width: 56px; height: 56px; left: 27px; top: -6px; }
    .theme-control .theme-switch__sun-moon-container { width: 34px; height: 34px; }
    .theme-toggle:checked + .theme-switch__container .theme-switch__circle-container { left: -7px; }
    .palette-items {
        position: fixed;
        top: 210px;
        right: 14px;
        max-width: calc(100vw - 28px);
        overflow-x: auto;
        padding-block: 9px;
    }
    .palette-item { width: 25px; }
    .search-section { padding: 20px 0 14px; }
    .search-shortcut { display: none; }
    .main-content { padding: 8px 0 16px; }
    .card-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 5px 4px; }
    .card { height: 82px; }
    .card-surface { padding-inline: 10px; }
    .card-icon-wrap { font-size: 1.5rem; }
    .card-textbox { padding: 0.8em; }
    .card-title-lower { right: 8px; bottom: 7px; left: 8px; width: calc(100% - 16px); font-size: 0.75em; }
    .card-title { font-size: 0.82em; }
    .card-description { font-size: 0.7em; }
    .github-profile { align-items: flex-start; gap: 10px; }
    .github-profile img { width: 44px; height: 44px; }
    .github-profile h2 { font-size: 0.85rem; }
    .github-stats { gap: 5px; font-size: 0.54rem; }
    .github-stat { min-width: 76px; }
    .github-stat-number { font-size: 1.06em; }
    .github-repos li a { padding-left: 13px; }
    .github-repos .repo-date { padding-left: 13px; }
    .emotion-ball-area { min-height: 420px; grid-template-rows: minmax(310px, 1fr) auto; }
    .emotion-ball-visual { width: min(86%, 420px); }
    .emotion-error-notice { top: 1%; left: 0; width: min(190px, 58%); padding: 7px 8px; font-size: 0.68rem; }
    .emotion-reply-bubble { width: min(190px, 52%); padding: 8px 10px; font-size: 0.72rem; }
    .emotion-settings { width: min(224px, calc(100% - 20px)); }
    .emotion-select { width: 124px; }
    .emotion-reply-bubble.position-left-top { top: 7%; left: 0; }
    .emotion-reply-bubble.position-left-mid { top: 32%; left: -2%; }
    .emotion-reply-bubble.position-right-top { top: 7%; right: 0; }
    .emotion-reply-bubble.position-right-mid { top: 32%; right: -2%; }
    .emotion-chat-form { margin-bottom: 14px; }
    .emotion-chat-form .emotion-model-toggle { width: 34px; height: 34px; }
    .site-footer {
        flex-direction: column;
        align-items: center;
        gap: 5px;
        margin-top: 24px;
        padding-top: 16px;
    }
}

@media (hover: none), (pointer: coarse) {
    .card-surface:active {
        background: var(--card-surface-hover);
        transform: scale(0.985);
    }
    .tool-button[data-tip]::after, .Btn[data-tip]::after, .theme-control[data-tip]::after { display: none; }
    .palette-item:hover, .palette-item:focus-visible { transform: scale(1.18); }
    .palette-item:hover + .palette-item,
    .palette-item:focus-visible + .palette-item,
    .palette-item:has(+ .palette-item:hover),
    .palette-item:has(+ .palette-item:focus-visible) { transform: scale(1.08); }
    .palette-item:hover + .palette-item + .palette-item,
    .palette-item:focus-visible + .palette-item + .palette-item,
    .palette-item:has(+ .palette-item + .palette-item:hover),
    .palette-item:has(+ .palette-item + .palette-item:focus-visible) { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
    .page-reveal, .card, .card-surface, .card-icon-wrap, .card-title-lower, .card-title, .theme-switch, .theme-switch:hover { transform: none; }
    .tool-dock, .tool-dock:hover { transform: none; }
    .card:hover, .card:focus-within { transform: none; }
    .card-icon-wrap { animation: none !important; filter: none; }
    .theme-toggle:checked + .theme-switch__container .theme-switch__circle-container { left: -7px; }
    .emotion-ball-area { min-height: 420px; }
    .emotion-ball { opacity: 0.82; }
    .emotion-reply-bubble { transition: none; }
    .card-textbox { transition: none; }
    .card-icon-wrap { animation: none !important; }
    .palette-item { transition: none; }
    .loader span,
    .loader::before,
    .loader::after { animation: none; }
    .ai-matrix-loader .digit,
    .ai-matrix-loader .glow { animation: none; }
    .ai-matrix-loader .digit { opacity: 0.8; transform: none; }
    .ai-matrix-loader .glow { opacity: 0.45; }
    .main-content { transition: none; }
    .main-content.cards-collapsed { max-height: 0; }
}
