:root {
    --bg: #fbf7f2;
    --surface: #ffffff;
    --ink: #1e1a16;
    --ink-2: #6b625a;
    --ink-3: #9c9288;
    --line: #ede5db;
    --line-soft: #f6f1ea;
    --accent: #e4572e;
    --accent-soft: #fbe9e2;
    --chip: #f4eee7;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

[hidden] {
    display: none !important;
}

.app {
    max-width: 520px;
    margin: 0 auto;
    padding: max(18px, env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
}

.screen {
    display: none;
}

.screen.is-active {
    display: block;
    animation: rise 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes pop {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---------- hero ---------- */

.hero {
    padding: 14px 2px 30px;
}

.city-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
}

.city-switch {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: var(--chip);
    border-radius: 999px;
}

.city-btn {
    border: 0;
    background: transparent;
    color: var(--ink-2);
    font: inherit;
    font-size: 12px;
    line-height: 1;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.city-btn.is-on {
    background: var(--surface);
    color: var(--ink);
}

.city-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ink-3);
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 18px;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--ink-3);
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.hero h1 {
    margin: 0;
    font-size: clamp(38px, 11vw, 46px);
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.lede {
    margin: 16px 0 0;
    font-size: 14px;
    color: var(--ink-2);
}

/* ---------- 一句话输入 ---------- */

.ask {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 15px 15px 12px;
    margin-bottom: 12px;
}

.ask-label {
    display: block;
    margin: 0 0 10px 2px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
}

.ask-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.ask-input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg);
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    -webkit-appearance: none;
}

.ask-input::placeholder {
    color: #b6ada3;
}

.ask-input:focus {
    outline: none;
    border-color: #eab6a5;
    background: #fff;
}

.ask-row .ask-btn {
    width: auto;
    flex: none;
    padding: 12px 22px;
    border-radius: 14px;
    font-size: 14.5px;
}

.ask-row .ask-btn:disabled {
    opacity: 0.6;
}

.ask-hint {
    margin: 9px 2px 0;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--ink-3);
}

.ask-hint.is-hit {
    color: #b8422a;
}

/* ---------- questions ---------- */

.question {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px 16px 10px;
    margin-bottom: 12px;
}

.q-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
}

.q-no {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    flex: none;
}

.q-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 8px;
}

.chip {
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--chip);
    color: #4a423b;
    font-family: inherit;
    font-size: 13.5px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.chip:active {
    transform: scale(0.95);
}

.chip.is-on {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 16px -8px rgba(228, 87, 46, 0.9);
}

/* ---------- buttons ---------- */

.cta {
    margin-top: 18px;
}

.btn {
    display: block;
    width: 100%;
    padding: 16px;
    border: 0;
    border-radius: 16px;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.18s ease;
}

.btn:active {
    transform: scale(0.985);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 26px -14px rgba(228, 87, 46, 1);
}

.btn-quiet {
    background: transparent;
    color: var(--ink-2);
    font-weight: 500;
    padding: 14px;
}

.btn-install {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-weight: 500;
    padding: 13px;
    margin-top: 4px;
}

/* ---------- result ---------- */

.bar-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0 16px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--chip);
    color: var(--ink);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    flex: none;
}

.bar-title {
    font-size: 13px;
    color: var(--ink-3);
}

.result-head {
    padding-bottom: 18px;
}

.result-head h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.tag {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #b8422a;
    font-size: 12px;
}

.note {
    margin: 12px 0 0;
    font-size: 12.5px;
    color: var(--ink-3);
}

.foot {
    margin: 18px 2px 10px;
    font-size: 11.5px;
    line-height: 1.65;
    color: #b0a79d;
}

.list {
    margin-bottom: 6px;
}

.empty {
    margin: 0 0 10px;
    padding: 26px 18px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 13.5px;
    line-height: 1.6;
    text-align: center;
}

.item {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    width: 100%;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.14s ease, border-color 0.2s ease;
}

.item:active {
    transform: scale(0.985);
    border-color: #e2d6c8;
}

.avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    flex: none;
}

.item-body {
    flex: 1;
    min-width: 0;
}

.item-line {
    display: flex;
    align-items: center;
    gap: 7px;
}

.item-name {
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.badge {
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
}

.item-meta {
    display: block;
    margin-top: 5px;
    font-size: 12.5px;
    color: var(--ink-3);
}

.item-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.reason {
    padding: 3px 8px;
    border-radius: 7px;
    background: var(--line-soft);
    color: #7a7169;
    font-size: 11px;
}

.rating {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: none;
    padding-top: 2px;
}

.rating b {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}

.rating i {
    font-style: normal;
    font-size: 10px;
    color: #b5ada4;
    margin-top: 1px;
}

/* ---------- detail ---------- */

.detail-head {
    text-align: center;
    padding: 6px 0 22px;
}

#detail-body {
    margin-bottom: 8px;
    padding-bottom: 72px;
}

.avatar-lg {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    font-size: 30px;
    margin: 0 auto 14px;
}

.detail-head h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.detail-meta {
    margin: 7px 0 0;
    font-size: 13px;
    color: var(--ink-2);
}

.detail-sub {
    margin: 5px 0 0;
    font-size: 12.5px;
    color: var(--ink-3);
    letter-spacing: 0.01em;
}

.tel {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(228, 87, 46, 0.32);
}

.detail-head .tag-row {
    justify-content: center;
}

.rows {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 2px 16px;
    margin-bottom: 12px;
}

.row {
    display: flex;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line-soft);
}

.row:last-child {
    border-bottom: 0;
}

.row dt {
    width: 46px;
    flex: none;
    font-size: 13px;
    color: var(--ink-3);
}

.row dd {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
}

.panel h3 {
    margin: 0 0 7px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-3);
}

.panel p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #4a423b;
}

.detail-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 10px;
    padding: 14px 0 calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 62%, rgba(251, 247, 242, 0));
}

.detail-actions .btn {
    flex: 1;
}

/* ---------- shake overlay ---------- */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(30, 26, 22, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: rise 0.2s ease;
}

.pick-card {
    width: 100%;
    max-width: 320px;
    padding: 26px 22px 18px;
    border-radius: 26px;
    background: var(--surface);
    text-align: center;
    animation: pop 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.pick-hint {
    margin: 0 0 18px;
    font-size: 12.5px;
    color: var(--ink-3);
}

.pick-avatar {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 34px;
    font-weight: 700;
    transition: background 0.12s ease;
}

.pick-name {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.02em;
    min-height: 30px;
}

.pick-meta {
    margin: 7px 0 0;
    font-size: 12.5px;
    color: var(--ink-2);
    min-height: 19px;
}

.pick-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.pick-actions .btn {
    flex: 1;
    padding: 13px;
    font-size: 14.5px;
}

.pick-actions .btn-quiet {
    background: var(--chip);
}

.pick-close {
    margin-top: 6px;
    padding: 10px;
    border: 0;
    background: transparent;
    color: var(--ink-3);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

/* ---------- toast ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(40px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 60;
    padding: 11px 20px;
    border-radius: 999px;
    background: rgba(30, 26, 22, 0.88);
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    animation: rise 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    .screen.is-active,
    .pick-card,
    .overlay,
    .toast {
        animation: none;
    }
    .chip,
    .item,
    .btn {
        transition: none;
    }
}
