:root {
    --ink: #1b1830;
    --muted: #716d80;
    --paper: rgba(255, 255, 255, .88);
    --line: rgba(39, 30, 72, .12);
    --violet: #6d43e5;
    --violet-dark: #5030b4;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 181, 232, .72), transparent 29%),
        radial-gradient(circle at 90% 18%, rgba(172, 212, 255, .7), transparent 31%),
        linear-gradient(155deg, #f9f2ff 0%, #eef6ff 50%, #fff8ef 100%);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button, input { font: inherit; }
button { touch-action: manipulation; }

.app-shell {
    width: min(100%, 680px);
    margin: 0 auto;
    padding: 30px 16px 34px;
}

.hero { padding: 8px 5px 24px; }
.eyebrow {
    color: var(--violet);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .17em;
}
.hero h1 {
    margin: 9px 0 9px;
    font-size: clamp(38px, 10vw, 58px);
    line-height: 1.08;
    letter-spacing: -.05em;
}
.hero p { margin: 0; color: var(--muted); font-size: 15px; }

.panel {
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 26px;
    background: var(--paper);
    box-shadow: 0 24px 70px rgba(65, 48, 108, .14);
    backdrop-filter: blur(18px);
}
.hidden { display: none !important; }
.panel > label { display: block; margin-bottom: 10px; font-size: 15px; font-weight: 850; }

.input-row { position: relative; }
.input-row input {
    width: 100%;
    height: 58px;
    padding: 0 66px 0 17px;
    border: 1px solid var(--line);
    border-radius: 15px;
    outline: 0;
    background: #fff;
    color: var(--ink);
    font-size: 18px;
    font-weight: 750;
    transition: border-color .2s, box-shadow .2s;
}
.input-row input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(109, 67, 229, .1); }
.input-row span { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); color: #9a96a5; font-size: 11px; }

.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.examples button {
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .75);
    color: #5d5869;
    font-size: 12px;
    cursor: pointer;
}
.examples button:hover { border-color: rgba(109, 67, 229, .35); color: var(--violet); }

.primary-button, .secondary-button {
    min-height: 52px;
    padding: 13px 18px;
    border-radius: 15px;
    font-weight: 900;
    cursor: pointer;
}
.primary-button { width: 100%; border: 0; background: var(--ink); color: #fff; }
.primary-button:hover { background: #2d2850; }
.primary-button:disabled { cursor: not-allowed; opacity: .38; }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.privacy-note { margin: 13px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

.result-panel { text-align: center; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; text-align: left; }
.result-heading span { color: var(--violet); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.result-heading h2 { margin: 5px 0 0; font-size: 22px; }
.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: white;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
}

.totem-stage {
    aspect-ratio: 1;
    margin: 20px auto 18px;
    overflow: hidden;
    border-radius: 22px;
    background: #f4f0ff;
    box-shadow: inset 0 0 0 1px rgba(55, 38, 103, .08);
}
.totem-stage svg { display: block; width: 100%; height: 100%; animation: reveal .65s cubic-bezier(.2,.8,.2,1); }
@keyframes reveal { from { opacity: 0; transform: scale(.88) rotate(-4deg); } }

blockquote { margin: 0; font-family: "STKaiti", "KaiTi", serif; font-size: clamp(23px, 6vw, 34px); font-weight: 700; }
.totem-id { margin-top: 8px; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.totem-id strong { color: var(--ink); }

.color-row { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 14px; padding: 12px 14px; border-radius: 14px; background: rgba(240, 237, 248, .72); }
.palette-dots { display: flex; }
.palette-dots i { width: 23px; height: 23px; margin-right: -5px; border: 2px solid white; border-radius: 50%; }
.color-row button, .text-button { border: 0; background: transparent; color: var(--violet); font-size: 12px; font-weight: 850; cursor: pointer; }
.result-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 9px; }
.text-button { margin-top: 15px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

footer { padding: 23px 0 0; color: #888292; font-size: 11px; text-align: center; }

@media (min-width: 600px) {
    .app-shell { padding-top: 48px; }
    .panel { padding: 34px; }
}

@media (max-width: 420px) {
    .app-shell { padding: 17px 12px 28px; }
    .hero { padding-bottom: 18px; }
    .hero h1 { font-size: 39px; }
    .panel { padding: 19px 17px; border-radius: 22px; }
    .totem-stage { margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
