/* ========================================
   书斋印社 · PRINTING HOUSE
   活版印刷主题 — 米白纸面 / 墨色文字 / 朱砂点缀
   ======================================== */

:root {
    --bg: #FAF7F2;
    --bg-card: #F4EFE6;
    --bg-input: #FFFFFF;
    --bg-hover: #F1EBDF;
    --bg-accent-light: #FBE9E5;

    --ink: #1C1917;
    --ink-secondary: #57534E;
    --ink-tertiary: #A8A29E;

    --border-light: #E8E0D4;
    --border-medium: #D6CCBB;

    --accent: #C93D3D;
    --accent-hover: #A82F2F;

    --success: #15803D;
    --success-bg: #EAF6EF;
    --success-text: #166534;

    --warning: #B45309;
    --warning-bg: #FBF3E7;
    --warning-text: #92400E;

    --danger: #C93D3D;
    --danger-bg: #FBE9E5;
    --danger-text: #9A2B2B;

    --shadow-xs: 0 1px 2px rgba(28, 25, 23, 0.05);
    --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-md: 0 4px 12px rgba(28, 25, 23, 0.07);
    --shadow-lg: 0 12px 32px rgba(28, 25, 23, 0.10);

    --radius-xs: 3px;
    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --font-serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
    --font-sans: 'Noto Serif SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-serif);
    overflow-x: hidden;
    background-color: var(--bg);
    background-image: radial-gradient(rgba(28, 25, 23, 0.05) 1px, transparent 1px);
    background-size: 22px 22px;
    color: var(--ink);
    line-height: 1.7;
    min-height: 100vh;
}

/* ===== Typography ===== */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); }
h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink); }
p  { color: var(--ink-secondary); }

/* ===== Container ===== */
.container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
    min-height: calc(100vh - 200px);
}

/* ===== Header / Nav ===== */
.site-header {
    background: rgba(250, 247, 242, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-seal {
    width: 34px;
    height: 34px;
    background: var(--accent);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.brand-name {
    font-size: 1.1875rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-link {
    position: relative;
    padding: 6px 14px;
    font-size: 0.9375rem;
    color: var(--ink-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.nav-link:hover { color: var(--ink); }

.nav-link.active {
    color: var(--ink);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -2px;
    height: 2px;
    background: var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-chip {
    font-size: 0.8125rem;
    color: var(--ink-secondary);
    border: 1px solid var(--border-medium);
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.4rem;
    border-radius: var(--radius-md);
    font-family: var(--font-serif);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    width: 100%;
}

.btn-solid {
    background: #141210;
    color: #FAF7F2;
}

.btn-solid:hover {
    background: #000;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--ink);
    color: var(--ink);
    width: auto;
}

.btn-outline:hover {
    background: var(--ink);
    color: #FAF7F2;
}

.btn-primary {
    background: var(--ink);
    color: #FAF7F2;
}

.btn-primary:hover {
    background: #000;
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: var(--ink-secondary);
    box-shadow: none;
    font-weight: 500;
    width: auto;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--ink);
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: 0.375rem 1rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
    width: auto;
}

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #116B34; }

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

.btn-outline-success {
    background: transparent;
    color: var(--success);
    border: 1.5px solid var(--success);
    box-shadow: none;
    width: auto;
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-outline-success:hover {
    background: var(--success-bg);
    transform: none;
    box-shadow: none;
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border: 1.5px solid var(--danger);
    box-shadow: none;
    width: auto;
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-outline-danger:hover {
    background: var(--danger-bg);
    transform: none;
    box-shadow: none;
}

.btn-submit {
    font-size: 1.0625rem;
    padding: 0.75rem 2.25rem;
    margin-top: 0.25rem;
    width: auto;
    border-radius: var(--radius-md);
}

.btn-red-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 5px;
    font-weight: 600;
    font-size: 1rem;
}

.btn-red-link:hover { color: var(--accent-hover); }

.btn-icon {
    background: transparent;
    border: none;
    color: var(--ink-tertiary);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.btn-icon:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 5rem 1rem 3.5rem;
    max-width: 860px;
    margin: 0 auto;
}

.hero-eyebrow {
    color: var(--accent);
    font-size: 0.8125rem;
    letter-spacing: 0.35em;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1.35;
    color: var(--ink);
    margin-bottom: 1.5rem;
}

.hero-sub {
    font-size: 1.0625rem;
    color: var(--ink-secondary);
    max-width: 640px;
    margin: 0 auto 2.5rem;
    line-height: 1.9;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.25rem;
}

.hero-actions .btn {
    width: auto;
    padding: 0.75rem 2.75rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

/* ===== Metrics (首页四宫格) ===== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1150px;
    margin: 0 auto 4.5rem;
    padding: 0 1.5rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.25rem 1rem 1.75rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.metric-note {
    font-size: 0.8125rem;
    color: var(--ink-tertiary);
}

/* ===== Section Divider ===== */
.section-divider {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 1150px;
    margin: 0 auto 2.25rem;
    padding: 0 1.5rem;
}

.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-medium);
}

.section-divider-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    white-space: nowrap;
}

/* ===== 首页公告预览 ===== */
.announcement-preview {
    max-width: 1150px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
    display: grid;
    gap: 0.75rem;
}

.announcement-preview-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.announcement-preview-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.ap-date { font-size: 0.8125rem; color: var(--ink-tertiary); white-space: nowrap; }
.ap-title { font-weight: 600; }

.ap-pin {
    font-size: 0.6875rem;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 1px 8px;
}

.announcement-preview-more { text-align: right; font-size: 0.875rem; }
.announcement-preview-more a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ===== 首页订单查询卡片 ===== */
.order-query-card {
    max-width: 1150px;
    width: calc(100% - 3rem);
    margin: 0 auto 4rem;
    padding: 1.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.order-query-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.oq-seal {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: var(--accent);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

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

.oq-title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 0.25rem;
}

.oq-desc {
    font-size: 0.875rem;
    color: var(--ink-secondary);
}

.oq-arrow {
    flex-shrink: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* ===== Card ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow-sm);
    max-width: 520px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

.card-narrow { max-width: 460px; }
.card-wide { max-width: 1150px; }

.card-header { margin-bottom: 1.5rem; }
.card-header h1 { margin-bottom: 0.25rem; }
.card-header p { font-size: 0.9375rem; color: var(--ink-secondary); }

/* ===== Form ===== */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: var(--font-serif);
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover { border-color: #BDB19C; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201, 61, 61, 0.12);
}

.form-group textarea { resize: vertical; min-height: 80px; }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2357534e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group-half { flex: 1; }

/* ===== Alert ===== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid #EFC8C2;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #BEE3CE;
}

.alert-info {
    background: var(--bg-accent-light);
    color: var(--ink-secondary);
    border: 1px solid #F3C9C0;
}

/* ===== Software Note ===== */
.software-note {
    display: none;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--warning-bg);
    border: 1px solid #EFDFC4;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--warning-text);
    line-height: 1.5;
    white-space: pre-wrap;
}

/* ===== Price Tip ===== */
.price-tip {
    background: var(--bg-accent-light);
    border: 1px solid #F3C9C0;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.9375rem;
    color: var(--ink);
    text-align: center;
}

.total-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

/* ===== 订单汇总条 ===== */
.order-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.75rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.order-total-summary {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.order-total-label { font-size: 0.9375rem; color: var(--ink-secondary); }

.order-total-groups,
.order-total-courses { font-size: 0.9375rem; color: var(--ink-secondary); }

.order-total-amount { font-size: 1.5rem; font-weight: 700; color: var(--accent); }

#discountBadge { background: var(--accent) !important; box-shadow: none !important; }

/* ===== 平台分组 ===== */
.platform-group {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.platform-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--border-light);
}

.platform-group-title { font-size: 1.0625rem; font-weight: 700; letter-spacing: 0.05em; }

.group-number { color: var(--accent); }

/* ===== 课程行 ===== */
.course-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.course-index {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-tertiary);
    min-width: 22px;
    text-align: right;
}

.course-name-input { flex: 1; }

.btn-add-course,
.btn-add-platform {
    background: transparent;
    border: 1px dashed var(--border-medium);
    color: var(--ink-secondary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-family: var(--font-serif);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-add-course:hover,
.btn-add-platform:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-accent-light);
}

.btn-add-platform {
    display: block;
    width: 100%;
    margin-bottom: 1.75rem;
    padding: 0.75rem;
    font-size: 0.9375rem;
}

.subtotal-display {
    margin-top: 0.75rem;
    padding: 0.625rem 1rem;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--ink-secondary);
}

.subtotal-display strong { color: var(--ink); font-weight: 700; }

.sub-total-amount { color: var(--accent) !important; }

/* 一级会员价格对比：原价划线 + 已省提示 */
.member-price-line {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--success);
}

.member-price-line .sub-original-price {
    color: var(--ink-tertiary);
    text-decoration: line-through;
    font-weight: 400;
}

.order-total-save { white-space: nowrap; }

/* ===== 服务条款页 ===== */
.terms-card { max-width: 860px; }

.terms-body h2 {
    font-size: 1.0625rem;
    margin: 1.5rem 0 0.5rem;
    padding-left: 0.625rem;
    border-left: 3px solid var(--accent);
}

.terms-body p {
    font-size: 0.9375rem;
    line-height: 1.9;
    margin: 0 0 0.5rem;
    color: var(--ink);
}

.terms-body b { color: var(--ink); }

/* ===== 学习通课程自选 ===== */
.btn-fetch-courses {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0.5rem 0 0.75rem;
    padding: 0.5rem 1.125rem;
    background: var(--bg-accent-light);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-serif);
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-fetch-courses:hover:not(:disabled) {
    background: var(--accent);
    color: #fff;
}

.btn-fetch-courses:disabled {
    opacity: 0.6;
    cursor: wait;
}

.course-fetch-msg {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.6;
}

.course-fetch-msg.msg-error { color: var(--danger-text); }
.course-fetch-msg.msg-ok { color: var(--success-text); }

.course-picker {
    margin-bottom: 1rem;
    background: #FFFFFF;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.course-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.course-picker-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-secondary);
    cursor: pointer;
}

/* 复选框重置：避免被 .form-group input 全局样式（width:100%+边框）撑成大盒子 */
.course-picker-toggle input[type="checkbox"],
.course-picker-item input[type="checkbox"] {
    width: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    accent-color: var(--accent);
}

.btn-picker-apply {
    padding: 0.375rem 1rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--font-serif);
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-picker-apply:hover { background: var(--accent-hover); }

.course-picker-list {
    max-height: 260px;
    overflow-y: auto;
}

/* 预置课程库点击 chip（无自动获取的平台点选课程） */
.course-lib-chip {
    display: inline-block;
    margin: 0.25rem 0.375rem 0.25rem 0;
    padding: 0.375rem 0.875rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 9999px;
    color: var(--ink-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.course-lib-chip:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.course-picker-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.1s ease;
}

.course-picker-item:last-child { border-bottom: none; }
.course-picker-item:hover { background: var(--bg-hover); }

.picker-course-name { font-weight: 600; color: var(--ink); }

.picker-course-extra {
    font-size: 0.75rem;
    color: var(--ink-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-meta-section {
    display: flex;
    gap: 1rem;
}

.order-meta-section .form-group { flex: 1; }

/* ===== 密码本 ===== */
.vault-input-wrap { position: relative; }

.vault-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 220px;
    overflow-y: auto;
}

.vault-suggestion-item {
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
}

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

.vault-suggestion-item:hover { background: var(--bg-hover); }

.vault-suggestion-item .vs-account { font-weight: 600; color: var(--ink); margin-right: 0.75rem; }
.vault-suggestion-item .vs-pwd { color: var(--ink-tertiary); }

.vault-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0.875rem;
    background: var(--bg-hover);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-right: 8px;
    margin-bottom: 6px;
    font-size: 0.8125rem;
}

.vault-chip:hover {
    border-color: var(--accent);
    background: var(--bg-accent-light);
    box-shadow: var(--shadow-xs);
}

.vault-chip-account { font-weight: 500; color: var(--ink); }

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--border-light);
    margin-top: 2rem;
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--ink-tertiary);
    font-size: 0.8125rem;
    letter-spacing: 0.15em;
}

.footer-inner {
    max-width: 1150px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-divider { width: 1px; height: 14px; background: var(--border-medium); }

.footer-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--ink-secondary);
}

.footer-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.footer-link a:hover { text-decoration: underline; }

/* ===== 付款页 ===== */
.payment-card { text-align: center; max-width: 480px; }

.payment-header-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 24px;
}

.payment-card h1 { margin-bottom: 0.25rem; }

.payment-subtitle {
    color: var(--ink-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

.order-summary {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: left;
    box-shadow: var(--shadow-xs);
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.order-summary-row .label { color: var(--ink-secondary); }
.order-summary-row .value { color: var(--ink); font-weight: 500; }

.order-summary-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 0.5rem 0;
}

.order-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.order-summary-total .amount {
    color: var(--accent);
    font-size: 1.5rem;
}

.order-items-list {
    border-top: 1px dashed var(--border-medium);
    margin: 0.75rem 0;
    padding-top: 0.75rem;
}

.order-item-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    margin-bottom: 0.625rem;
    background: var(--bg-hover);
}

.order-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.order-item-software { font-weight: 700; font-size: 0.875rem; }
.order-item-subtotal { font-weight: 700; color: var(--accent); font-size: 0.875rem; }

.order-item-field { display: flex; gap: 0.75rem; font-size: 0.8125rem; }

.order-item-courses {
    margin: 0.25rem 0 0 1.25rem;
    font-size: 0.8125rem;
    color: var(--ink-secondary);
}

.qrcode-box {
    background: var(--bg-hover);
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.qrcode-img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.75rem;
}

.qrcode-tip { font-size: 0.875rem; color: var(--ink-secondary); }

.payment-reminder {
    background: var(--warning-bg);
    border: 1px solid #EFDFC4;
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--warning-text);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* ===== 管理后台 ===== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-header h1 { margin: 0; }
.admin-actions { display: flex; align-items: center; gap: 0.75rem; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-xs);
    animation: fadeIn 0.3s ease;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-secondary);
    margin-bottom: 0.25rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.stat-card.stat-total .stat-value { color: var(--ink); }
.stat-card.stat-pending .stat-value { color: var(--warning); }
.stat-card.stat-completed .stat-value { color: var(--success); }
.stat-card.stat-unpaid .stat-value { color: var(--danger); }
.stat-card.stat-paid .stat-value { color: var(--accent); }

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 1.5rem;
    padding: 4px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.filter-link {
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--ink-secondary);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.filter-link:hover { color: var(--ink); background: rgba(28, 25, 23, 0.05); }

.filter-link.active {
    background: #FFFFFF;
    color: var(--ink);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: #FFFFFF;
    box-shadow: var(--shadow-xs);
}

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

thead th {
    padding: 0.75rem 0.875rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--ink-secondary);
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

tbody td {
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-pending { background: var(--warning-bg); color: var(--warning-text); }
.badge-pending::before { background: var(--warning); }

.badge-completed { background: var(--success-bg); color: var(--success-text); }
.badge-completed::before { background: var(--success); }

.badge-unpaid { background: var(--danger-bg); color: var(--danger-text); }
.badge-unpaid::before { background: var(--danger); }

.badge-paid { background: #EAF0FA; color: #1D4ED8; }
.badge-paid::before { background: #3B82F6; }

.badge-member { background: #FEF3C7; color: #B45309; }
.badge-member::before { background: #F59E0B; }

.badge-multi {
    background: var(--bg-accent-light);
    color: var(--accent);
    border: 1px solid #F3C9C0;
    border-radius: 9999px;
    padding: 1px 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-pinned { background: var(--warning-bg); color: var(--warning-text); }
.badge-active { background: var(--success-bg); color: var(--success-text); }
.badge-inactive { background: var(--danger-bg); color: var(--danger-text); }

/* Action group */
.action-group { display: flex; gap: 4px; flex-wrap: nowrap; }
.action-group form { display: inline; }

/* Empty State */
.empty-state { text-align: center; padding: 4rem 1rem; }

.empty-state-icon { font-size: 3rem; margin-bottom: 0.75rem; opacity: 0.4; }
.empty-state p { font-size: 0.9375rem; color: var(--ink-tertiary); }

.course-count-badge {
    cursor: help;
    border-bottom: 1px dashed var(--border-medium);
    color: var(--ink-secondary);
    font-size: 0.8125rem;
}

/* ===== 公告页 ===== */
.announcement-page { max-width: 1150px; margin: 0 auto; }

.announcement-header { margin-bottom: 2rem; }
.announcement-header h1 { margin-bottom: 0.25rem; }
.announcement-header p { color: var(--ink-secondary); font-size: 0.9375rem; }

.announcement-list { display: grid; gap: 1.25rem; }

.announcement-card {
    background: #FFFFFF;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-xs);
    position: relative;
}

.announcement-card.pinned { border-left: 3px solid var(--accent); }

.announcement-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.6875rem;
    border-radius: 999px;
    padding: 1px 10px;
    margin-bottom: 0.5rem;
}

.announcement-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.25rem; }

.announcement-meta { font-size: 0.8125rem; color: var(--ink-tertiary); margin-bottom: 0.75rem; }

.announcement-content { font-size: 0.9375rem; color: var(--ink); line-height: 1.9; white-space: pre-wrap; }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.55);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-content {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h2 { font-size: 1.125rem; }

.modal-body { padding: 1.25rem 1.5rem; }

.pinned-notice { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px dashed var(--border-medium); }
.pinned-notice:last-child { border-bottom: none; }

.pinned-notice h3 { font-size: 1rem; margin-bottom: 0.5rem; }

.notice-content { font-size: 0.9375rem; line-height: 1.9; white-space: pre-wrap; color: var(--ink); }

.notice-time { margin-top: 0.5rem; font-size: 0.8125rem; color: var(--ink-tertiary); }

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    text-align: right;
}

.modal-footer .btn { width: auto; }

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 表格横滑提示：仅小屏出现 */
.scroll-hint { display: none; }

/* 用户中心 Tab */
.uc-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 0.5rem;
}

.uc-tabs .btn {
    width: auto;
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
}

/* ===== 移动端底部结算栏（仅小屏显示） ===== */
.mobile-checkout-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    align-items: center;
    justify-content: space-between;
    gap: 0.875rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-light);
    padding: 0.625rem 1rem calc(0.625rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 16px rgba(28, 25, 23, 0.08);
}

.mobile-checkout-info { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.mobile-checkout-label { font-size: 0.75rem; color: var(--ink-tertiary); }
.mobile-checkout-amount { font-size: 1.25rem; font-weight: 700; color: var(--accent); }

.mobile-checkout-bar .btn {
    width: auto;
    flex-shrink: 0;
    min-height: 46px;
    padding: 0.625rem 1.5rem;
    font-size: 0.9375rem;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .nav-links { gap: 0; }
    .nav-link { padding: 6px 10px; font-size: 0.875rem; }
}

@media (max-width: 860px) {
    /* 触摸反馈 */
    a, button, label, select { -webkit-tap-highlight-color: rgba(201, 61, 61, 0.12); }

    /* iOS 聚焦不放大整页：表单字号必须 ≥16px */
    input, select, textarea,
    .form-group input,
    .form-group select,
    .form-group textarea { font-size: 16px; }

    /* 顶部：品牌 + 操作同排，导航单独一行横向滚动 */
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        min-height: 56px;
        padding: 0.625rem 1rem;
        gap: 0.5rem 0.75rem;
    }
    .brand-seal { width: 30px; height: 30px; font-size: 18px; }
    .brand-name { font-size: 1rem; letter-spacing: 0.04em; }
    .header-actions { margin-left: auto; gap: 8px; }
    .header-actions .btn-sm {
        padding: 0.3125rem 0.75rem;
        font-size: 0.75rem;
        min-height: 32px;
    }
    .user-chip {
        padding: 2px 8px;
        font-size: 0.75rem;
        max-width: 116px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 0.375rem;
        border-bottom: 1px solid var(--border-light);
    }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-link { padding: 8px 10px; font-size: 0.875rem; }
    .nav-link.active::after { left: 10px; right: 10px; bottom: 0; }

    /* 容器与卡片 */
    .container { padding: 1.25rem 0.875rem 2rem; }
    .card { padding: 1.25rem 1rem; border-radius: var(--radius-lg); }
    .hero { padding: 2.5rem 1rem 2rem; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* 表单：单列 + 加大点按高度 */
    .order-meta-section { flex-direction: column; gap: 0; }
    .form-row { flex-direction: column; gap: 0; }
    .form-group { margin-bottom: 1rem; }
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.75rem 0.875rem;
        min-height: 46px;
    }
    .form-group textarea { min-height: 92px; }

    /* 平台分组 */
    .platform-group { padding: 1rem 0.875rem; margin-bottom: 1rem; }
    .platform-group-header { margin-bottom: 1rem; padding-bottom: 0.625rem; }

    /* 课程行：删除按钮放大到能点中 */
    .course-row { gap: 6px; margin-bottom: 8px; }
    .course-index { min-width: 20px; font-size: 0.75rem; }
    .course-remove,
    .platform-group-remove {
        min-width: 38px;
        min-height: 38px;
        padding: 0;
        font-size: 1.125rem;
        flex-shrink: 0;
    }
    .btn-add-course { width: 100%; min-height: 44px; margin-top: 0.5rem; }
    .btn-add-platform { min-height: 46px; }
    .course-lib-chip { min-height: 36px; padding: 0.375rem 0.875rem; }
    .vault-suggestion-item { padding: 0.75rem 0.875rem; }
    .course-picker-item { padding: 0.75rem; }

    /* 顶部合计条收紧，提交交给底部吸底栏 */
    .order-total-bar {
        flex-direction: row;
        align-items: center;
        padding: 0.875rem 1rem;
        margin-bottom: 1rem;
        gap: 0.5rem;
    }
    .order-total-summary { gap: 0.625rem; }
    .order-total-label,
    .order-total-groups,
    .order-total-courses { font-size: 0.8125rem; }
    .order-total-amount { font-size: 1.25rem; }
    .order-total-bar .btn-submit { display: none; }

    .mobile-checkout-bar { display: flex; }
    body.has-checkout-bar { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

    /* 后台 */
    .admin-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .admin-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 0.75rem 0.875rem; }
    .stat-card .stat-value { font-size: 1.125rem; }
    thead th, tbody td { padding: 0.5rem 0.5rem; font-size: 0.75rem; }
    .table-wrapper { -webkit-overflow-scrolling: touch; }
    .table-wrapper table { min-width: 520px; }
    .scroll-hint {
        display: block;
        font-size: 0.75rem;
        color: var(--ink-tertiary);
        margin-bottom: 0.5rem;
    }
    .order-query-card { padding: 1.25rem 1rem; gap: 0.75rem; }

    /* 弹层 */
    .modal-content { max-height: 88vh; }
    .modal-header, .modal-body { padding: 1rem; }
    .modal-footer { padding: 0.875rem 1rem; }
    .modal-footer .btn { min-height: 44px; }

    /* 点按目标下限 */
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .btn-outline-danger,
    .btn-outline-success { min-height: 36px; padding: 0.375rem 0.75rem; }
}

@media (max-width: 560px) {
    h1 { font-size: 1.25rem; }
    h2 { font-size: 1.0625rem; }
    .container { padding: 1rem 0.75rem 1.75rem; }
    .card { padding: 1rem 0.875rem; }
    .hero-title { font-size: 1.75rem; }
    .hero-actions { flex-direction: column; gap: 0.75rem; }
    .hero-actions .btn { width: 100%; }
    .metric-value { font-size: 1.5rem; }
    .filter-link { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
    .footer-inner { flex-direction: column; gap: 0.25rem; font-size: 0.75rem; }
    .footer-divider { display: none; }
    .order-query-card { flex-direction: column; align-items: stretch; gap: 0.75rem; width: auto; }
    .order-total-summary { gap: 0.5rem; }
    .subtotal-display { font-size: 0.8125rem; padding: 0.5rem 0.75rem; }
    .qrcode-box { padding: 1rem; }
    .qrcode-img { width: min(220px, 62vw); height: auto; }
    .mobile-checkout-amount { font-size: 1.125rem; }
    .mobile-checkout-bar .btn { padding: 0.625rem 1.125rem; }
    .uc-tabs .btn { flex: 1; padding: 0.625rem 0.5rem; }
    .order-card { padding: 1rem 0.875rem !important; }
}
