:root {
    --theme: #F5734A;
    --theme-soft: rgba(245, 115, 74, .1);
    --ink: #241f1c;
    --ink-2: #5d5754;
    --ink-3: #948d88;
    --line: #ece7e2;
    --bg: #f7f4f1;
    --card: #fff;
    --radius: 18px;
    --shadow: 0 8px 24px rgba(58, 40, 32, .06);
}

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

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

body { padding-bottom: 96px; }

/* ---------- 头部 ---------- */
.hero {
    position: relative;
    padding: 30px 22px 46px;
    background: linear-gradient(135deg, var(--theme) 0%, #ff9a6c 60%, #ffb98f 100%);
    border-radius: 0 0 30px 30px;
    color: #fff;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    right: -46px;
    top: -56px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
}
.hero::before {
    content: "";
    position: absolute;
    left: -30px;
    bottom: -60px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
}
.hero .dept {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .2);
    font-size: 12px;
    letter-spacing: .5px;
    backdrop-filter: blur(4px);
}
.hero h1 {
    position: relative;
    margin: 14px 0 6px;
    font-size: 22px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: .3px;
}
.hero p {
    position: relative;
    margin: 0;
    font-size: 13px;
    opacity: .9;
}
.hero .meta {
    position: relative;
    margin-top: 16px;
    display: flex;
    gap: 18px;
    font-size: 12px;
    opacity: .92;
}
.hero .meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- 主体 ---------- */
.wrap {
    max-width: 620px;
    margin: -26px auto 0;
    padding: 0 16px;
    position: relative;
}

.progress-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.progress-card .ring {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--theme);
    background: conic-gradient(var(--theme) var(--p, 0%), #f2ece7 0);
    flex: none;
}
.progress-card .ring i {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    font-style: normal;
}
.progress-card .txt strong { display: block; font-size: 14px; font-weight: 600; }
.progress-card .txt span { font-size: 12px; color: var(--ink-3); }

.block {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 18px;
    margin-top: 14px;
}
.block-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}
.block-title .bar {
    width: 4px;
    height: 16px;
    border-radius: 3px;
    background: var(--theme);
}
.block-title small {
    font-weight: 400;
    font-size: 12px;
    color: var(--ink-3);
    margin-left: auto;
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label {
    display: block;
    font-size: 13px;
    color: var(--ink-2);
    margin-bottom: 7px;
}
.field label em { color: var(--theme); font-style: normal; margin-left: 2px; }
.field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fbfaf9;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--ink);
    font-family: inherit;
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
    appearance: none;
}
.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23948d88' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--theme);
    background: #fff;
    box-shadow: 0 0 0 3px var(--theme-soft);
}
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }

/* ---------- 评价项 ---------- */
.item {
    padding: 16px 0;
    border-top: 1px dashed var(--line);
}
.item:first-of-type { border-top: 0; padding-top: 4px; }
.item-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.item-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--theme-soft);
    color: var(--theme);
    display: grid;
    place-items: center;
    flex: none;
}
.item-icon svg { width: 20px; height: 20px; }
.item-name { font-size: 15px; font-weight: 600; }
.item-tip { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.item-state {
    margin-left: auto;
    font-size: 12px;
    color: var(--ink-3);
    white-space: nowrap;
    padding-top: 3px;
}
.item-state.done { color: var(--theme); font-weight: 600; }

.options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.option {
    position: relative;
    border: 1px solid var(--line);
    background: #fbfaf9;
    border-radius: 12px;
    padding: 10px 4px 9px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-2);
    cursor: pointer;
    transition: all .18s ease;
    user-select: none;
}
.option .dot {
    display: block;
    width: 18px;
    height: 18px;
    margin: 0 auto 6px;
    border-radius: 50%;
    border: 1.5px solid #d9d2cc;
    background: #fff;
    transition: all .18s ease;
}
.option:active { transform: scale(.97); }
.option.active {
    border-color: var(--theme);
    background: var(--theme-soft);
    color: var(--theme);
    font-weight: 600;
    box-shadow: 0 4px 12px var(--theme-soft);
}
.option.active .dot {
    border-color: var(--theme);
    background: var(--theme);
    box-shadow: inset 0 0 0 3.5px #fff;
}

/* ---------- 菜品入口 ---------- */
.dish-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: linear-gradient(120deg, #fff6f1, #fff);
    border: 1px solid #ffe3d6;
    text-decoration: none;
    color: var(--ink);
}
.dish-entry .emoji {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: #fff;
    display: grid; place-items: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(245,115,74,.12);
}
.dish-entry .txt strong { display: block; font-size: 14px; }
.dish-entry .txt span { font-size: 12px; color: var(--ink-3); }
.dish-entry .arrow { margin-left: auto; color: var(--theme); font-size: 18px; }

/* ---------- 底部提交 ---------- */
.footer-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 20;
}
.footer-inner { max-width: 620px; margin: 0 auto; }
.btn {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(135deg, var(--theme), #ff9a6c);
    box-shadow: 0 10px 22px var(--theme-soft);
    cursor: pointer;
    transition: transform .15s, opacity .2s;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.foot-note {
    text-align: center;
    font-size: 11px;
    color: var(--ink-3);
    margin: 12px 0 0;
}

/* ---------- 成功态 ---------- */
.success-card {
    background: var(--card);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 36px 24px 28px;
    text-align: center;
    margin-top: 28px;
}
.success-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    margin: 0 auto 18px;
    display: grid; place-items: center;
    background: var(--theme-soft);
    color: var(--theme);
}
.success-icon svg { width: 36px; height: 36px; }
.success-card h2 { margin: 0 0 8px; font-size: 20px; }
.success-card p { margin: 0; color: var(--ink-3); font-size: 13px; }
.score-row {
    display: flex;
    gap: 12px;
    margin: 22px 0 4px;
}
.score-cell {
    flex: 1;
    background: #fbf8f5;
    border-radius: 14px;
    padding: 14px 8px;
}
.score-cell b { display: block; font-size: 22px; color: var(--theme); font-weight: 700; }
.score-cell span { font-size: 12px; color: var(--ink-3); }

/* ---------- 状态 ---------- */
.loading { padding: 80px 0; text-align: center; color: var(--ink-3); font-size: 13px; }
.spinner {
    display: inline-block;
    width: 26px; height: 26px;
    border: 2.5px solid #eee3dc;
    border-top-color: var(--theme);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
    padding: 60px 24px;
    text-align: center;
    color: var(--ink-3);
    font-size: 14px;
}

.toast {
    position: fixed;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%) scale(.9);
    background: rgba(36, 31, 28, .9);
    color: #fff;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 13px;
    max-width: 76%;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all .22s ease;
    z-index: 99;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@media (max-width: 360px) {
    .options { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 19px; }
}

/* ---------- H5 手机号账号 ---------- */
.hero .meta .logout {
    margin-left: auto;
    text-decoration: underline;
    cursor: pointer;
    opacity: .9;
}

.auth-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 20px 24px;
}

.auth-tabs {
    display: flex;
    background: #f7f3f0;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 18px;
}

.auth-tab {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 10px 0;
    border-radius: 9px;
    font-size: 14px;
    color: var(--ink-3);
    cursor: pointer;
    font-family: inherit;
    transition: all .18s;
}

.auth-tab.active {
    background: #fff;
    color: var(--theme);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(58, 40, 32, .08);
}

.auth-submit { width: 100%; margin-top: 6px; }

.auth-tip {
    font-size: 12px;
    color: var(--ink-3);
    text-align: center;
    margin: 14px 0 0;
    line-height: 1.7;
}

.switch-account {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
}

.switch-account a {
    color: var(--ink-3);
    text-decoration: underline;
    cursor: pointer;
}

.hero .meta .login-link {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .22);
    text-decoration: none;
    cursor: pointer;
}

.guest-tip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 15px;
    margin-bottom: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(245, 115, 74, .18);
    font-size: 12.5px;
    color: var(--ink-2);
}

.guest-tip a {
    color: var(--theme);
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
}

.auth-back {
    text-align: center;
    margin: 16px 0 0;
    font-size: 13px;
}

.auth-back a {
    color: var(--theme);
    text-decoration: none;
    cursor: pointer;
}

/* ---------- 底部菜单 ---------- */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    height: 58px;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid #eee8e3;
    box-shadow: 0 -6px 20px rgba(58, 40, 32, .06);
    z-index: 40;
}

.tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #948d88;
    text-decoration: none;
    font-size: 11px;
}

.tabbar a.active { color: var(--theme); font-weight: 600; }
.tabbar .tab-ico svg { width: 21px; height: 21px; display: block; }

body.with-tabbar { padding-bottom: 58px; }
body.with-tabbar .footer-bar { bottom: calc(58px + env(safe-area-inset-bottom)); }
body.with-tabbar .wrap { padding-bottom: 96px; }
