:root {
    --bg: #f4f6fa;
    --card: #ffffff;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e5e9f0;
    --brand: #0d9488;
    --brand-dark: #0f766e;
    --brand-deep: #134e4a;
    --brand-soft: #ccfbf1;
    --brand-soft2: #e6fffb;
    --accent: #f59e0b;
    --accent-soft: #fef3c7;
    --star: #f59e0b;
    --success: #16a34a;
    --warn: #b45309;
    --error: #dc2626;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-lg: 0 12px 28px -8px rgba(16, 24, 40, 0.16);
    --radius: 14px;
    --radius-sm: 9px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
    font-size: 15px;
}

.container { max-width: 1024px; margin: 0 auto; padding: 0 18px; }

/* ---------- 顶栏 ---------- */
.topbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    min-height: 60px;
}

.logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: "";
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    box-shadow: 0 4px 10px -2px rgba(13, 148, 136, 0.5);
}

.logo em { font-style: normal; color: var(--brand); }

.nav { display: flex; gap: 6px; flex-wrap: wrap; }

.nav a {
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    border-bottom: none;
    transition: color 0.15s, background 0.15s;
}

.nav a:hover {
    color: var(--brand);
    background: var(--brand-soft2);
}

.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.hello { color: var(--muted); font-size: 14px; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle:hover { background: #f1f5f9; }

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #334155;
    border-radius: 2px;
}

@media (max-width: 860px) {
    .topbar-inner { gap: 10px; }

    .nav-toggle { display: flex; }

    .userbox { margin-left: 0; gap: 6px; }

    .nav {
        display: none;
        width: 100%;
        order: 10;
        flex-direction: column;
        gap: 4px;
        padding: 10px 0 6px;
        border-top: 1px solid var(--line);
    }

    .topbar-inner.nav-open .nav { display: flex; }

    .nav a { font-size: 15px; padding: 9px 12px; }

    .hello { display: none; }

    .btn-sm { padding: 5px 10px; font-size: 12px; }
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: var(--shadow);
}

.btn-sm { padding: 5px 13px; font-size: 13px; }

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 14px -6px rgba(13, 148, 136, 0.55);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-deep));
    color: #fff;
    transform: translateY(-1px);
}

.btn-block { width: 100%; padding: 11px; font-size: 15px; }

.btn-danger {
    background: #fff;
    border-color: #fecaca;
    color: var(--error);
}

.btn-danger:hover { background: var(--error); border-color: var(--error); color: #fff; }

.btn-xs { padding: 2px 9px; font-size: 12px; }

/* ---------- 消息 ---------- */
.flashes { margin: 18px 0; }

.flash {
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    font-size: 14px;
    border: 1px solid transparent;
}

.flash-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.flash-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.flash-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.16) 0, rgba(255, 255, 255, 0) 42%),
        linear-gradient(135deg, #0d9488 0%, #115e59 60%, #134e4a 100%);
    color: #fff;
    border-radius: 18px;
    padding: 30px 28px;
    margin: 22px 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 26px solid rgba(255, 255, 255, 0.06);
}

.hero h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.hero p { margin: 0; color: rgba(255, 255, 255, 0.88); font-size: 14px; }

/* ---------- 统计 ---------- */
.stats { display: flex; gap: 14px; margin: 18px 0; flex-wrap: wrap; }

.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 22px;
    text-align: center;
    flex: 1;
    min-width: 130px;
    box-shadow: var(--shadow-sm);
}

.stat-card .num {
    font-size: 28px;
    font-weight: 800;
    color: var(--brand);
    line-height: 1.2;
}

.stat-card .label { font-size: 13px; color: var(--muted); }

/* ---------- 卡片 ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.card h2 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    border-left: 4px solid var(--brand);
    padding-left: 12px;
}

.section-title {
    margin: 26px 0 14px;
    font-size: 19px;
    font-weight: 800;
    color: var(--ink);
}

.section-title::after {
    content: "";
    display: block;
    width: 34px;
    height: 4px;
    border-radius: 2px;
    margin-top: 6px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

/* ---------- 排行 ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; }

.rank-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
    border-radius: 10px;
    margin: 0 -6px;
    transition: background 0.12s;
}

.rank-item:last-child { border-bottom: none; }

.rank-item:hover { background: #f8fafc; }

.rank-badge {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    background: #eef2f7;
    color: #64748b;
}

.rank-badge.r1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; box-shadow: 0 4px 10px -3px rgba(245, 158, 11, 0.5); }
.rank-badge.r2 { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #1e293b; }
.rank-badge.r3 { background: linear-gradient(135deg, #fed7aa, #d97706); color: #431407; }

.rank-info { flex: 1; min-width: 0; }

.rank-name { font-size: 15px; font-weight: 600; }

.rank-meta { font-size: 12px; color: var(--muted); }

.rank-score { text-align: right; flex-shrink: 0; }

.rank-score .avg { font-size: 19px; font-weight: 800; color: var(--brand); }

.rank-score .sub { font-size: 12px; color: var(--muted); }

.stars { color: var(--star); letter-spacing: 2px; font-size: 14px; }

.pill {
    display: inline-block;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 20px;
    background: var(--brand-soft2);
    color: var(--brand-dark);
    margin-left: 6px;
    font-weight: 500;
}

/* ---------- 分类宫格 ---------- */
.grid-cat {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.cat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 16px;
    text-decoration: none;
    color: var(--ink);
    display: block;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.cat-card:hover {
    border-color: var(--brand);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.cat-card .icon {
    font-size: 26px;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--brand-soft2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.cat-card .name { font-size: 16px; font-weight: 700; margin: 0 0 3px; }

.cat-card .desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------- 商家详情 ---------- */
.biz-head { margin-bottom: 6px; }
.biz-head h1 { margin: 0 0 6px; font-size: 24px; font-weight: 800; }
.biz-meta { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.biz-desc { color: #4b5563; font-size: 14px; }

/* ---------- 点评 ---------- */
.review {
    border-left: 4px solid var(--brand-soft);
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #fbfcfe;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.review .author { font-size: 13px; color: var(--muted); }
.review .author .name { font-weight: 700; color: var(--ink); }
.review .content { margin: 6px 0 2px; font-size: 14px; white-space: pre-wrap; color: #374151; }
.review .date { font-size: 12px; color: var(--muted); display: flex; align-items: center; }

/* ---------- 表单 ---------- */
.review-form label { display: block; font-size: 14px; font-weight: 500; margin: 14px 0 5px; }

.rating-input { display: flex; gap: 6px; flex-direction: row-reverse; justify-content: flex-end; }

.rating-input input { display: none; }

.rating-input label {
    font-size: 28px;
    cursor: pointer;
    color: #d6dbe3;
    margin: 0;
    transition: color 0.15s, transform 0.1s;
}

.rating-input label:hover { transform: scale(1.12); }

.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label {
    color: var(--star);
}

input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

textarea { min-height: 110px; resize: vertical; }

.form-card { max-width: 440px; margin: 44px auto; }

.form-card h1 { font-size: 22px; text-align: center; }

.form-row { margin-bottom: 15px; }

.form-row label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 5px; }

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

.anonymous-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0;
    font-size: 14px;
}

.anonymous-toggle input { accent-color: var(--brand); width: 16px; height: 16px; }

/* ---------- 上传 ---------- */
.upload-row {
    display: flex;
    gap: 12px;
    margin: 12px 0 4px;
    flex-wrap: wrap;
}

.upload-box {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 18px;
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    background: #fbfcfe;
    transition: border-color 0.15s, background 0.15s;
}

.upload-box:hover { border-color: var(--brand); background: var(--brand-soft2); }

.upload-box input[type="file"] { display: none; }

.upload-icon { font-size: 20px; }
.upload-text { color: var(--ink); font-weight: 500; }

.review-imgs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.review-imgs a { display: block; }

.review-imgs img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.review-imgs img:hover { transform: scale(1.05); box-shadow: var(--shadow); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table-wrap .data-table { min-width: 640px; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th, .data-table td {
    padding: 9px 11px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    font-size: 13px;
}

.data-table tbody tr:hover td { background: #f8fafc; }

.data-table td a { color: var(--brand); text-decoration: none; }
.data-table td a:hover { text-decoration: underline; }

/* ---------- 其他 ---------- */
.footer {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 30px 0;
}

.empty { color: var(--muted); font-size: 14px; padding: 12px 0; }

.back-link { font-size: 13px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--brand); }

.inline-form { display: inline-block; margin-left: 8px; }

@media (max-width: 860px) {
    .hero { padding: 22px 18px; }
    .hero h1 { font-size: 22px; }
    .stats { gap: 10px; }
    .stat-card { padding: 13px 10px; min-width: 0; }
    .stat-card .num { font-size: 23px; }
    .rank-item { gap: 10px; padding: 11px 8px; margin: 0 -4px; }
    .rank-badge { width: 32px; height: 32px; font-size: 14px; }
    .rank-name { font-size: 14px; }
    .rank-score .avg { font-size: 17px; }
    .review-imgs img { width: 80px; height: 80px; }
    .card { padding: 15px 15px; }
    .form-card { margin: 26px auto; }
    .rating-input label { font-size: 25px; }
    .container { padding: 0 12px; }
    .review { padding: 10px 12px; }
}

@media (max-width: 480px) {
    .grid-cat { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .cat-card { padding: 14px 12px; }
    .cat-card .icon { width: 44px; height: 44px; font-size: 22px; }
    .stats { display: grid; grid-template-columns: repeat(2, 1fr); }
    .upload-row { flex-direction: column; }
    .upload-box { width: 100%; justify-content: center; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 6px 6px; }
    .logo { font-size: 18px; }
    .review .content { font-size: 13px; }
    .biz-head h1 { font-size: 21px; }
}
