:root {
    --paper: #f5f1e8;
    --paper-deep: #e8e0d1;
    --surface: rgba(255, 253, 248, 0.9);
    --surface-solid: #fffdf8;
    --ink: #202722;
    --ink-soft: #4e5751;
    --muted: #747c76;
    --line: rgba(45, 54, 48, 0.13);
    --line-strong: rgba(45, 54, 48, 0.22);
    --cinnabar: #b24435;
    --cinnabar-dark: #91372b;
    --jade: #47685a;
    --shadow-sm: 0 8px 24px rgba(42, 36, 27, 0.06);
    --shadow-lg: 0 28px 70px rgba(42, 36, 27, 0.14);
    --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
    --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    --brush: "Ma Shan Zheng", "STKaiti", "KaiTi", cursive;
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --drawer-width: 440px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

a {
    color: inherit;
}

::selection {
    color: #fff;
    background: var(--cinnabar);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ambient {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(246, 242, 233, 0.12), rgba(246, 242, 233, 0.46)),
        url("./background.jpg") center / cover no-repeat;
}

.ambient::before {
    position: absolute;
    inset: -4%;
    content: "";
    background:
        radial-gradient(circle at 7% 9%, rgba(255, 252, 238, 0.82), transparent 34%),
        linear-gradient(120deg, rgba(243, 235, 217, 0.42), rgba(226, 218, 201, 0.22));
    backdrop-filter: blur(2px) saturate(0.82);
    -webkit-backdrop-filter: blur(2px) saturate(0.82);
}

.ambient::after {
    position: absolute;
    inset: 0;
    content: "";
    opacity: 0.2;
    background-image:
        repeating-linear-gradient(0deg, transparent 0 3px, rgba(54, 45, 33, 0.035) 3px 4px),
        radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0 0.6px, transparent 0.8px);
    background-size: auto, 6px 6px;
    mix-blend-mode: multiply;
}

#app-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(circle at 92% 2%, var(--active-color, var(--cinnabar)) 0, transparent 44%),
        radial-gradient(circle at 8% 94%, rgba(255, 255, 255, 0.42), transparent 40%);
    transition: opacity 500ms ease, background-color 500ms ease;
}

body.color-active #app-background {
    opacity: 0.2;
}

.app-shell {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 94px;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    color: var(--ink);
    text-decoration: none;
}

.brand-seal {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #fff9f0;
    background: var(--cinnabar);
    border: 1px solid rgba(126, 34, 26, 0.2);
    border-radius: 12px 8px 11px 8px;
    box-shadow:
        inset 0 0 0 3px rgba(255, 248, 237, 0.15),
        0 7px 18px rgba(144, 54, 42, 0.2);
    font-family: var(--brush);
    font-size: 23px;
    transform: rotate(-3deg);
}

.brand-copy {
    display: grid;
    line-height: 1;
}

.brand-copy strong {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.brand-copy small {
    margin-top: 8px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.23em;
}

.home-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 16px;
    color: var(--ink-soft);
    background: rgba(255, 253, 248, 0.58);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.home-link svg {
    width: 16px;
    height: 16px;
}

.home-link:hover {
    color: var(--cinnabar);
    background: rgba(255, 253, 248, 0.94);
    border-color: rgba(178, 68, 53, 0.28);
    transform: translateY(-1px);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(290px, 0.8fr);
    align-items: center;
    min-height: 410px;
    padding: 46px 0 60px;
    gap: 70px;
}

.hero-copy {
    max-width: 720px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
    color: var(--cinnabar);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.eyebrow::before {
    width: 34px;
    height: 1px;
    content: "";
    background: currentColor;
}

.hero h1 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(46px, 6vw, 74px);
    font-weight: 600;
    line-height: 1.16;
    letter-spacing: -0.045em;
}

.hero h1 span {
    position: relative;
    display: inline-block;
    color: var(--cinnabar);
}

.hero h1 span::after {
    position: absolute;
    right: 2%;
    bottom: -4px;
    left: 3%;
    height: 8px;
    content: "";
    opacity: 0.35;
    background: url("data:image/svg+xml,%3Csvg width='220' height='8' viewBox='0 0 220 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 6C48 1 118 1 218 4' stroke='%23b24435' stroke-width='3' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.hero-lead {
    max-width: 590px;
    margin: 24px 0 28px;
    color: var(--ink-soft);
    font-family: var(--serif);
    font-size: 17px;
    line-height: 1.95;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    color: #5f685f;
    background: rgba(255, 253, 248, 0.55);
    border: 1px solid rgba(66, 76, 68, 0.11);
    border-radius: 999px;
    font-size: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.feature-pill i {
    width: 5px;
    height: 5px;
    background: var(--jade);
    border-radius: 50%;
}

.hero-art {
    position: relative;
    display: grid;
    min-height: 300px;
    place-items: center;
}

.palette-orbit {
    position: relative;
    width: 294px;
    height: 294px;
    border: 1px solid rgba(80, 70, 56, 0.14);
    border-radius: 50%;
}

.palette-orbit::before,
.palette-orbit::after {
    position: absolute;
    content: "";
    border-radius: 50%;
}

.palette-orbit::before {
    inset: 28px;
    border: 1px dashed rgba(80, 70, 56, 0.18);
    animation: orbit-spin 34s linear infinite;
}

.palette-orbit::after {
    inset: 68px;
    background:
        radial-gradient(circle at 33% 28%, rgba(255, 255, 255, 0.82), transparent 24%),
        rgba(255, 250, 241, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.palette-color {
    position: absolute;
    z-index: 2;
    width: 60px;
    height: 60px;
    border: 4px solid rgba(253, 249, 240, 0.88);
    border-radius: 50% 44% 52% 47%;
    box-shadow: 0 12px 28px rgba(47, 38, 27, 0.16);
}

.palette-color-1 {
    top: 13px;
    left: 62px;
    background: #b83f32;
    transform: rotate(8deg);
}

.palette-color-2 {
    top: 104px;
    right: -10px;
    width: 52px;
    height: 52px;
    background: #d7af45;
    transform: rotate(-7deg);
}

.palette-color-3 {
    right: 48px;
    bottom: 5px;
    width: 57px;
    height: 57px;
    background: #45695c;
    transform: rotate(12deg);
}

.palette-color-4 {
    bottom: 33px;
    left: 9px;
    width: 48px;
    height: 48px;
    background: #39546e;
    transform: rotate(-12deg);
}

.seal-card {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    display: grid;
    width: 82px;
    height: 128px;
    padding: 12px 10px;
    place-items: center;
    color: #f7eee1;
    background: #29342e;
    border: 4px double rgba(243, 231, 211, 0.22);
    box-shadow: 0 16px 30px rgba(37, 44, 39, 0.23);
    font-family: var(--serif);
    font-size: 21px;
    line-height: 1.25;
    letter-spacing: 0.08em;
    transform: translate(-50%, -50%) rotate(2deg);
}

.orbit-caption {
    position: absolute;
    right: 6px;
    bottom: 5px;
    z-index: 4;
    color: rgba(46, 55, 48, 0.48);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.26em;
    writing-mode: vertical-rl;
}

@keyframes orbit-spin {
    to {
        transform: rotate(360deg);
    }
}

.studio {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(74, 61, 44, 0.04);
    backdrop-filter: blur(22px) saturate(1.08);
    -webkit-backdrop-filter: blur(22px) saturate(1.08);
}

.studio-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 28px;
    background: rgba(240, 235, 225, 0.55);
    border-bottom: 1px solid var(--line);
}

.studio-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #6f8c79;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(111, 140, 121, 0.11);
}

.shortcut-hint {
    color: var(--muted);
    font-size: 11px;
}

.shortcut-hint kbd {
    display: inline-block;
    min-width: 22px;
    margin: 0 2px;
    padding: 3px 5px;
    color: #606861;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-family: var(--sans);
    font-size: 9px;
    line-height: 1;
    text-align: center;
}

.studio-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.13fr) minmax(340px, 0.87fr);
    min-height: 520px;
}

.input-panel,
.result-panel {
    min-width: 0;
    padding: 36px;
}

.input-panel {
    border-right: 1px solid var(--line);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.section-icon {
    display: grid;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    place-items: center;
    color: var(--cinnabar);
    background: rgba(178, 68, 53, 0.08);
    border: 1px solid rgba(178, 68, 53, 0.12);
    border-radius: 12px;
}

.section-icon svg {
    width: 19px;
    height: 19px;
}

.section-heading h2 {
    margin: 1px 0 7px;
    font-family: var(--serif);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.textarea-shell {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.48) 1px, transparent 1px) 0 0 / 34px 100%,
        rgba(249, 246, 239, 0.76);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.textarea-shell:focus-within {
    background-color: rgba(255, 253, 248, 0.96);
    border-color: rgba(178, 68, 53, 0.48);
    box-shadow: 0 0 0 4px rgba(178, 68, 53, 0.08);
}

.textarea-shell.has-error {
    border-color: var(--cinnabar);
    animation: input-shake 280ms ease;
}

#main-input {
    display: block;
    width: 100%;
    min-height: 176px;
    padding: 20px 20px 42px;
    resize: vertical;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.9;
}

#main-input::placeholder {
    color: #94998f;
}

.input-counter {
    position: absolute;
    right: 15px;
    bottom: 12px;
    color: #9a9d95;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.form-message {
    min-height: 19px;
    margin: 8px 2px 2px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.form-message.is-error {
    color: var(--cinnabar);
}

.examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 18px 0 24px;
}

.examples-label {
    margin-right: 2px;
    color: var(--muted);
    font-size: 11px;
}

.example-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    color: #667068;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.example-button::before {
    width: 4px;
    height: 4px;
    content: "";
    background: var(--dot-color, var(--cinnabar));
    border-radius: 50%;
}

.example-button:nth-of-type(2) {
    --dot-color: #d09d3e;
}

.example-button:nth-of-type(3) {
    --dot-color: #4b7463;
}

.example-button:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.65);
    border-color: var(--line-strong);
}

.submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 0 20px;
    color: #fffaf3;
    background: var(--cinnabar);
    border: 0;
    border-radius: 13px;
    box-shadow: 0 10px 24px rgba(178, 68, 53, 0.19);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.submit-button:hover {
    background: var(--cinnabar-dark);
    box-shadow: 0 13px 28px rgba(178, 68, 53, 0.24);
    transform: translateY(-1px);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:focus-visible,
.example-button:focus-visible,
.color-chip:focus-visible,
.icon-button:focus-visible,
.copy-button:focus-visible {
    outline: 3px solid rgba(178, 68, 53, 0.25);
    outline-offset: 3px;
}

.button-label,
.button-loader,
.button-icon {
    display: inline-flex;
    align-items: center;
}

.button-icon {
    margin-left: 11px;
    transition: transform 180ms ease;
}

.button-icon svg {
    width: 17px;
    height: 17px;
}

.submit-button:hover .button-icon {
    transform: translateX(3px);
}

.button-loader {
    display: none;
    width: 17px;
    height: 17px;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.submit-button.is-loading {
    cursor: wait;
    opacity: 0.88;
}

.submit-button.is-loading .button-loader {
    display: inline-block;
}

.submit-button.is-loading .button-icon {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes input-shake {
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

.result-panel {
    display: flex;
    flex-direction: column;
    background: rgba(234, 228, 217, 0.26);
}

.result-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.result-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-title-wrap h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 700;
}

.result-count {
    display: none;
    min-width: 26px;
    padding: 3px 7px;
    color: var(--cinnabar);
    background: rgba(178, 68, 53, 0.08);
    border: 1px solid rgba(178, 68, 53, 0.1);
    border-radius: 999px;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.result-count.is-visible {
    display: inline-block;
}

.result-subtitle {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.08em;
}

#result-display {
    flex: 1 1 auto;
    min-height: 360px;
    max-height: 510px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-color: rgba(76, 85, 78, 0.28) transparent;
    scrollbar-width: thin;
}

#result-display::-webkit-scrollbar {
    width: 6px;
}

#result-display::-webkit-scrollbar-track {
    background: transparent;
}

#result-display::-webkit-scrollbar-thumb {
    background: rgba(76, 85, 78, 0.22);
    border-radius: 999px;
}

.empty-state {
    display: grid;
    min-height: 360px;
    padding: 34px;
    place-items: center;
    text-align: center;
    border: 1px dashed rgba(68, 78, 71, 0.18);
    border-radius: var(--radius-lg);
}

.empty-palette {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 86px;
    margin: 0 auto 24px;
}

.empty-palette span {
    display: block;
    width: 43px;
    height: 67px;
    margin-left: -9px;
    border: 3px solid rgba(255, 253, 248, 0.9);
    border-radius: 50% 50% 12px 12px;
    box-shadow: 0 10px 22px rgba(44, 39, 31, 0.12);
    transform-origin: bottom center;
}

.empty-palette span:first-child {
    margin-left: 0;
    background: #b54a3a;
    transform: rotate(-17deg);
}

.empty-palette span:nth-child(2) {
    background: #d3ae55;
    transform: rotate(-7deg);
}

.empty-palette span:nth-child(3) {
    background: #496c5e;
    transform: rotate(5deg);
}

.empty-palette span:nth-child(4) {
    background: #445f75;
    transform: rotate(15deg);
}

.empty-state h3 {
    margin: 0 0 10px;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 600;
}

.empty-state p {
    max-width: 250px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.loading-state .empty-palette span {
    animation: palette-pulse 1.2s ease-in-out infinite alternate;
}

.loading-state .empty-palette span:nth-child(2) {
    animation-delay: 120ms;
}

.loading-state .empty-palette span:nth-child(3) {
    animation-delay: 240ms;
}

.loading-state .empty-palette span:nth-child(4) {
    animation-delay: 360ms;
}

@keyframes palette-pulse {
    to {
        transform: translateY(-8px) rotate(0);
    }
}

.sentence-list {
    display: grid;
    gap: 13px;
}

.sentence-group {
    padding: 18px;
    opacity: 0;
    background: rgba(255, 253, 248, 0.72);
    border: 1px solid rgba(59, 68, 61, 0.09);
    border-radius: var(--radius-md);
    box-shadow: 0 5px 18px rgba(45, 38, 29, 0.035);
    transform: translateY(10px);
    transition: opacity 380ms ease, transform 380ms ease;
}

.sentence-group.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.sentence-head {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 15px;
}

.sentence-index {
    flex: 0 0 auto;
    padding-top: 2px;
    color: rgba(178, 68, 53, 0.7);
    font-family: var(--serif);
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sentence-text {
    margin: 0;
    color: #59625b;
    font-family: var(--serif);
    font-size: 13px;
    line-height: 1.75;
}

.color-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.color-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 49px;
    padding: 7px 12px 7px 14px;
    color: var(--chip-ink, #fff);
    background: var(--chip-color, #ccc);
    border: 1px solid rgba(32, 39, 34, 0.08);
    border-radius: 13px;
    box-shadow: 0 6px 14px color-mix(in srgb, var(--chip-color, #ccc) 22%, transparent);
    cursor: pointer;
    text-align: left;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.color-chip:hover {
    border-color: rgba(32, 39, 34, 0.16);
    box-shadow: 0 10px 22px color-mix(in srgb, var(--chip-color, #ccc) 31%, transparent);
    transform: translateY(-3px);
}

.chip-name {
    font-family: var(--serif);
    font-size: 15px;
    font-weight: 700;
}

.chip-hex {
    padding-left: 10px;
    opacity: 0.7;
    border-left: 1px solid currentColor;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 9px;
    letter-spacing: 0.02em;
}

.no-result-state {
    display: grid;
    min-height: 360px;
    padding: 34px;
    place-items: center;
    text-align: center;
}

.no-result-mark {
    display: grid;
    width: 62px;
    height: 62px;
    margin-bottom: 18px;
    place-items: center;
    color: var(--muted);
    border: 1px dashed var(--line-strong);
    border-radius: 50%;
    font-family: var(--serif);
    font-size: 20px;
}

.no-result-state h3 {
    margin: 0 0 9px;
    font-family: var(--serif);
    font-size: 17px;
}

.no-result-state p {
    max-width: 260px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 30px 4px 38px;
    color: rgba(52, 61, 55, 0.55);
    font-size: 10px;
    line-height: 1.7;
}

.footer-seal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-seal::before {
    width: 16px;
    height: 16px;
    content: "色";
    color: rgba(178, 68, 53, 0.82);
    border: 1px solid rgba(178, 68, 53, 0.42);
    font-family: var(--brush);
    font-size: 10px;
    line-height: 14px;
    text-align: center;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    visibility: hidden;
    background: rgba(31, 36, 32, 0.23);
    opacity: 0;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: opacity 300ms ease, visibility 300ms ease;
}

.drawer-overlay.is-open {
    visibility: visible;
    opacity: 1;
}

.color-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    width: min(var(--drawer-width), 100%);
    height: 100dvh;
    color: var(--ink);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--drawer-accent, #b24435) 11%, #fbf8f1) 0, #fbf8f1 33%),
        var(--surface-solid);
    border-left: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: -22px 0 60px rgba(39, 33, 26, 0.16);
    opacity: 0;
    transform: translateX(104%);
    transition: transform 420ms cubic-bezier(0.2, 0.82, 0.24, 1), opacity 260ms ease;
}

.color-drawer.is-open {
    opacity: 1;
    transform: translateX(0);
}

.drawer-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    min-height: 74px;
    padding: 0 26px;
    border-bottom: 1px solid var(--line);
}

.drawer-kicker {
    margin: 0;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.24em;
}

.icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover {
    color: var(--cinnabar);
    background: rgba(255, 255, 255, 0.9);
    transform: rotate(6deg);
}

.icon-button svg {
    width: 17px;
    height: 17px;
}

.drawer-scroll {
    overflow-y: auto;
    padding: 25px 26px 34px;
    scrollbar-color: rgba(76, 85, 78, 0.28) transparent;
    scrollbar-width: thin;
}

.color-preview {
    position: relative;
    height: 176px;
    overflow: hidden;
    background: var(--drawer-accent, #b24435);
    border: 1px solid rgba(35, 40, 36, 0.08);
    border-radius: 20px;
    box-shadow: 0 18px 36px color-mix(in srgb, var(--drawer-accent, #b24435) 24%, transparent);
}

.color-preview::after {
    position: absolute;
    inset: 0;
    content: "";
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 40%),
        repeating-linear-gradient(118deg, transparent 0 27px, rgba(255, 255, 255, 0.035) 27px 28px);
    mix-blend-mode: soft-light;
}

.color-preview::before {
    position: absolute;
    right: 14px;
    bottom: 10px;
    z-index: 1;
    content: "TRADITIONAL CHINESE COLOR";
    color: var(--preview-label, rgba(255, 255, 255, 0.72));
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.22em;
}

.color-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin: 23px 0 22px;
}

.color-title {
    min-width: 0;
}

.color-title h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: 38px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.04em;
}

.color-pinyin {
    margin: 7px 0 0;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 14px;
    font-style: italic;
    letter-spacing: 0.04em;
}

.copy-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 11px;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--line);
    border-radius: 9px;
    cursor: pointer;
    font-size: 10px;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.copy-button:hover,
.copy-button.is-copied {
    color: var(--cinnabar);
    background: #fff;
    border-color: rgba(178, 68, 53, 0.25);
}

.copy-button svg {
    width: 14px;
    height: 14px;
}

.color-codes {
    padding: 17px 18px;
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 31px;
    color: var(--ink);
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
}

.code-row + .code-row {
    border-top: 1px solid rgba(50, 60, 53, 0.08);
}

.code-label {
    color: var(--muted);
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.rgb-values {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rgb-channel {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.channel-dot {
    width: 7px;
    height: 7px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 50%;
}

.drawer-section {
    padding: 24px 1px;
    border-bottom: 1px solid var(--line);
}

.drawer-section:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.drawer-section h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 12px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.drawer-section h3::before {
    width: 15px;
    height: 1px;
    content: "";
    background: var(--cinnabar);
}

.drawer-section p {
    margin: 0;
    color: #5d665f;
    font-size: 12px;
    line-height: 1.95;
}

.drawer-section p + p {
    margin-top: 10px;
}

.detail-description {
    font-family: var(--serif);
    font-size: 13px !important;
    line-height: 2.05 !important;
}

.similarity-list {
    display: grid;
    gap: 11px;
}

.similarity-bar-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
    font-size: 10px;
}

.bar-label {
    color: var(--ink-soft);
    font-family: var(--serif);
    font-weight: 600;
}

.bar-bg {
    height: 6px;
    overflow: hidden;
    background: rgba(57, 67, 60, 0.09);
    border-radius: 999px;
}

.bar-fill {
    width: 0;
    height: 100%;
    background: var(--bar-color);
    border-radius: inherit;
    transition: width 600ms cubic-bezier(0.16, 0.84, 0.3, 1);
}

.bar-percentage {
    color: var(--muted);
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 9px;
    text-align: right;
}

body.drawer-open {
    overflow: hidden;
}

body.drawer-open #site-pet-widget {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

@media (max-width: 980px) {
    .hero {
        grid-template-columns: minmax(0, 1fr) 270px;
        gap: 32px;
    }

    .hero h1 {
        font-size: clamp(43px, 6vw, 62px);
    }

    .palette-orbit {
        width: 250px;
        height: 250px;
    }

    .studio-grid {
        grid-template-columns: minmax(0, 1fr) minmax(310px, 0.85fr);
    }

    .input-panel,
    .result-panel {
        padding: 28px;
    }
}

@media (max-width: 780px) {
    .app-shell {
        width: min(100% - 28px, 680px);
    }

    .site-header {
        min-height: 76px;
    }

    .hero {
        display: block;
        min-height: auto;
        padding: 52px 0 48px;
    }

    .hero-copy {
        max-width: 620px;
    }

    .hero-art {
        display: none;
    }

    .hero h1 {
        font-size: clamp(42px, 12vw, 60px);
    }

    .hero-lead {
        font-size: 15px;
    }

    .studio-grid {
        grid-template-columns: 1fr;
    }

    .input-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    #main-input {
        min-height: 150px;
    }

    #result-display,
    .empty-state,
    .no-result-state {
        min-height: 300px;
    }

    .page-footer {
        padding-bottom: 28px;
    }
}

@media (max-width: 560px) {
    .app-shell {
        width: min(100% - 20px, 520px);
    }

    .brand-copy small {
        display: none;
    }

    .home-link {
        min-height: 38px;
        padding: 0 12px;
    }

    .home-link span {
        display: none;
    }

    .hero {
        padding: 42px 2px 38px;
    }

    .eyebrow {
        margin-bottom: 17px;
        font-size: 10px;
    }

    .hero h1 {
        font-size: clamp(39px, 13vw, 54px);
        letter-spacing: -0.055em;
    }

    .hero-lead {
        margin: 20px 0 23px;
        font-size: 14px;
        line-height: 1.85;
    }

    .feature-pill {
        padding: 7px 10px;
        font-size: 10px;
    }

    .studio {
        border-radius: 21px;
    }

    .studio-bar {
        min-height: 51px;
        padding: 0 18px;
    }

    .shortcut-hint {
        display: none;
    }

    .input-panel,
    .result-panel {
        padding: 22px 18px 24px;
    }

    .section-heading {
        margin-bottom: 18px;
    }

    .section-heading h2 {
        font-size: 19px;
    }

    #main-input {
        min-height: 144px;
        padding: 16px 16px 38px;
        font-size: 15px;
    }

    .examples {
        margin: 16px 0 20px;
    }

    .examples-label {
        width: 100%;
    }

    .example-button {
        flex: 1 1 auto;
        justify-content: center;
    }

    .result-panel-heading {
        margin-bottom: 16px;
    }

    .result-subtitle {
        display: none;
    }

    .sentence-group {
        padding: 16px;
    }

    .color-chip {
        flex: 1 1 132px;
        justify-content: space-between;
    }

    .page-footer {
        display: grid;
        gap: 5px;
        padding: 24px 4px;
    }

    .color-drawer {
        top: auto;
        bottom: 0;
        width: 100%;
        height: min(91dvh, 860px);
        border-top: 1px solid rgba(255, 255, 255, 0.8);
        border-left: 0;
        border-radius: 26px 26px 0 0;
        box-shadow: 0 -24px 60px rgba(39, 33, 26, 0.18);
        transform: translateY(104%);
    }

    .color-drawer.is-open {
        transform: translateY(0);
    }

    .drawer-topbar {
        min-height: 62px;
        padding: 0 20px;
    }

    .drawer-topbar::before {
        position: absolute;
        top: 8px;
        left: 50%;
        width: 36px;
        height: 4px;
        content: "";
        background: rgba(62, 70, 64, 0.17);
        border-radius: 999px;
        transform: translateX(-50%);
    }

    .drawer-scroll {
        padding: 18px 20px 30px;
    }

    .color-preview {
        height: 142px;
        border-radius: 16px;
    }

    .color-title-row {
        margin: 18px 0;
    }

    .color-title h2 {
        font-size: 32px;
    }

    .drawer-section {
        padding: 20px 1px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
