/* ========== 设计 Token（企业级主题） ========== */
:root {
    /* 主色 - 企业蓝 */
    --color-primary: #1677ff;
    --color-primary-hover: #4096ff;
    --color-primary-bg: rgba(22, 119, 255, 0.06);
    --color-primary-border: rgba(22, 119, 255, 0.2);

    /* 语义色 */
    --color-danger: #ff4d4f;
    --color-warning: #faad14;
    --color-success: #52c41a;
    --color-muted: #9ca3af;

    /* 中性色 */
    --page-bg: #f5f7fa;
    --card-bg: #ffffff;
    --section-bg: #ffffff;
    --border: #e5e7eb;
    --border-light: #f0f1f3;

    /* 文字 */
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --text-caption: #9ca3af;

    /* 圆角 */
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;

    /* 阴影 - 极简 */
    --shadow-card: 0 1px 2px 0 rgba(0, 0, 0, 0.03),
                   0 1px 6px -1px rgba(0, 0, 0, 0.02),
                   0 2px 4px 0 rgba(0, 0, 0, 0.02);
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.06);

    /* 字体 */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
    --font-mono: "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono",
                 Menlo, "Courier New", monospace;
}

/* ========== Reset ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--page-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== Header ========== */
.site-header {
    position: relative;
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    overflow: hidden;
}

/* 头部背景装饰：柔和渐变 + 底部品牌色细线 */
.site-header-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1200px 200px at 0% 0%, rgba(22, 119, 255, 0.06), transparent 60%),
        radial-gradient(900px 200px at 100% 100%, rgba(22, 119, 255, 0.04), transparent 60%),
        linear-gradient(180deg, #fafcff 0%, #ffffff 100%);
    pointer-events: none;
}

.site-header::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(22, 119, 255, 0.25) 20%,
        var(--color-primary) 50%,
        rgba(22, 119, 255, 0.25) 80%,
        transparent 100%);
}

.site-header-inner {
    position: relative;
    padding: 22px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    box-shadow:
        0 4px 10px rgba(22, 119, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.brand-text {
    min-width: 0;
    flex: 1;
}

.brand-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.brand-sub {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.brand-sub .dot {
    color: var(--color-primary);
    opacity: 0.5;
    font-weight: 700;
}

/* 免责声明提示条 */
.site-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #fffbe6 0%, #fff7e6 100%);
    border: 1px solid #ffe7ba;
    border-left: 3px solid #faad14;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: #8c6d2f;
    line-height: 1.6;
}

.site-notice .notice-icon {
    font-size: 14px;
    color: #faad14;
    flex-shrink: 0;
    line-height: 1;
}

/* ========== Stats ========== */
.stats-section {
    padding: 24px 0 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--stat-accent, var(--color-primary));
    opacity: 0.85;
}

.stat-card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border);
}

.stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-bottom: 10px;
    display: block;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--stat-color, var(--text-primary));
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.stat-0 { --stat-accent: var(--color-danger);  --stat-color: var(--color-danger); }
.stat-1 { --stat-accent: var(--color-primary); --stat-color: var(--color-primary); }
.stat-2 { --stat-accent: var(--color-warning); --stat-color: #d48806; }
.stat-3 { --stat-accent: var(--color-success); --stat-color: #389e0d; }

/* ========== Content Layout (双栏) ========== */
.content-section {
    padding: 16px 0 40px;
    flex: 1;
}

.content-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ========== Side Ads (固定在视口两侧) ========== */
.side-ads {
    position: fixed;
    top: 0;
    width: 240px;
    z-index: 50;
    display: flex;
    align-items: flex-start;
    padding-top: 90px;
    padding-bottom: 90px;
    pointer-events: none;
}
.side-ads-left {
    left: 0;
    justify-content: flex-start;
    padding-left: 8px;
}

.side-ads-right {
    right: 0;
    justify-content: flex-end;
    padding-right: 8px;
}

.side-ads-inner {
    width: 100%;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(229, 231, 235, 0.6);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.side-ads-inner::-webkit-scrollbar {
    width: 4px;
}

.side-ads-inner::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.side-ads-inner::-webkit-scrollbar-track {
    background: transparent;
}

/* 广告位标识 */
.side-ads-inner::before {
    content: '推广';
    display: block;
    text-align: center;
    font-size: 10px;
    color: #9ca3af;
    letter-spacing: 1px;
    padding: 2px 0 6px;
    border-bottom: 1px dashed rgba(229, 231, 235, 0.8);
    margin-bottom: 4px;
    font-weight: 500;
}

/* HTML 广告内容优化：允许文字换行，避免截断 */
.ad-html-wrap {
    width: 100%;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
}

.ad-html-wrap img {
    max-width: 100%;
    height: auto;
}

.ad-html-wrap a {
    text-decoration: none;
    color: inherit;
}

/* 覆盖用户 HTML 中的 white-space:nowrap，允许文字换行 */
.ad-html-wrap [style*="white-space:nowrap"],
.ad-html-wrap [style*="white-space: nowrap"] {
    white-space: normal !important;
}

/* ========== Content Layout ========== */
.content-main {
    flex: 1;
    min-width: 0;
}

.content-sidebar {
    flex-shrink: 0;
    width: 300px;
    position: sticky;
    top: 16px;
}

.ad-item {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s ease;
    display: block;
}

.ad-item:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border);
    transform: translateY(-2px);
}

.ad-item img {
    width: 100%;
    display: block;
}

.ad-item-body {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
    background: var(--page-bg);
}

.ad-item-html img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* HTML 类型广告：直接输出，不添加额外容器样式 */
.ad-html-wrap {
    width: 100%;
    line-height: 1.6;
}

.ad-html-wrap img {
    max-width: 100%;
    height: auto;
}

.ad-html-wrap a {
    text-decoration: none;
    color: inherit;
}

.ad-html-wrap a:hover {
    text-decoration: none;
    color: inherit;
}

/* ========== Clock Card ========== */
.clock-card {
    background: linear-gradient(135deg, #1677ff 0%, #4096ff 100%);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    color: #fff;
    box-shadow:
        0 4px 12px rgba(22, 119, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

/* 时钟卡片背景装饰 */
.clock-card::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.clock-card::after {
    content: '';
    position: absolute;
    bottom: -30px; left: -30px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.clock-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.clock-icon {
    font-size: 14px;
}

.clock-time {
    font-family: var(--font-mono);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.clock-date {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 6px;
    position: relative;
    z-index: 1;
}

/* ========== Announcement Card ========== */
.announcement-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fff7e6, #fffbe6);
    border-bottom: 1px solid #ffe7ba;
    font-weight: 600;
    font-size: 15px;
    color: #d46b08;
}

.announcement-icon {
    font-size: 18px;
}

.announcement-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: #d48806;
    background: #fff;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #ffe7ba;
    font-family: var(--font-mono);
}

/* ========== Announcement Carousel ========== */
.announcement-carousel {
    position: relative;
    overflow: hidden;
}

.carousel-wrapper {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 240px;
}

.carousel-item {
    min-width: 100%;
    padding: 18px 20px;
    box-sizing: border-box;
    overflow-y: auto;
    max-height: 480px;
}

.carousel-item-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.carousel-item-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--color-primary);
    border-radius: 2px;
}

.carousel-item-meta {
    font-size: 11px;
    color: var(--text-caption);
    font-family: var(--font-mono);
    margin-bottom: 10px;
}

.carousel-body {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.carousel-body h1 { font-size: 18px; font-weight: 700; margin: 12px 0 8px; color: var(--text-primary); }
.carousel-body h2 { font-size: 16px; font-weight: 700; margin: 10px 0 6px; color: var(--text-primary); }
.carousel-body h3 { font-size: 14px; font-weight: 600; margin: 8px 0 4px; color: var(--text-primary); }
.carousel-body p { margin: 0 0 8px; }
.carousel-body ul, .carousel-body ol { margin: 0 0 8px; padding-left: 20px; }
.carousel-body li { margin: 3px 0; }
.carousel-body blockquote { border-left: 3px solid #1677ff; margin: 0 0 8px; padding: 4px 12px; background: #f0f5ff; color: #475569; }
.carousel-body blockquote p { margin: 0; }
.carousel-body code { background: #f6f8fa; padding: 1px 5px; border-radius: 4px; font-family: monospace; font-size: 12px; color: #c7254e; }
.carousel-body pre { background: #1e293b; color: #e2e8f0; padding: 12px; border-radius: 8px; overflow-x: auto; margin: 0 0 8px; }
.carousel-body pre code { background: none; color: inherit; padding: 0; }
.carousel-body a { color: var(--color-primary); text-decoration: none; }
.carousel-body a:hover { text-decoration: underline; }
.carousel-body hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.carousel-body strong { font-weight: 700; }
.carousel-body img { max-width: 100%; border-radius: 6px; }

/* 指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.carousel-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d9d9d9;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.carousel-indicator:hover {
    background: var(--color-primary-hover);
}

.carousel-indicator.active {
    background: var(--color-primary);
    width: 18px;
    border-radius: 3px;
}

/* 左右箭头 */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
    opacity: 0;
    padding: 0;
}

.announcement-carousel:hover .carousel-arrow {
    opacity: 1;
}

.carousel-arrow:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }

/* 单条公告时隐藏控制元素 */
.announcement-card.single .carousel-indicators,
.announcement-card.single .carousel-arrow {
    display: none !important;
}

.loading {
    padding: 64px 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.user-grid {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* ========== User Card ========== */
.user-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
    overflow: hidden;
}

.user-card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border);
}

.user-card-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-light);
}

.header-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* 排名 */
.rank {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    color: var(--text-tertiary);
    background: var(--page-bg);
    border: 1px solid var(--border-light);
}

.rank.rank-1 { color: #d48806; background: #fffbe6; border-color: #ffe58f; }
.rank.rank-2 { color: #595959; background: #fafafa; border-color: #d9d9d9; }
.rank.rank-3 { color: #ad4e00; background: #fff7e6; border-color: #ffd591; }

/* 用户基本信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary-border);
    color: var(--color-primary);
    font-weight: 600;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-meta { min-width: 0; flex: 1; }

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-qq {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 总金额 */
.user-total {
    text-align: right;
    flex-shrink: 0;
}

.total-label {
    font-size: 12px;
    color: var(--text-caption);
    margin-bottom: 6px;
    display: block;
}

.total-amount {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-danger);
    letter-spacing: -0.3px;
    line-height: 1;
}
.total-amount.amount-medium { color: #d48806; }
.total-amount.amount-small  { color: #389e0d; }

/* 额外信息行 */
.user-sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.sub-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sub-item .sub-key {
    color: var(--text-caption);
}

.sub-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    background: var(--color-primary-bg);
    color: var(--color-primary);
    border: 1px solid var(--color-primary-border);
}

/* ========== Records ========== */
.records {
    padding: 16px 20px 20px;
}

.records-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    min-height: 28px;
}

.records-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.records-header-right {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.records-sort {
    font-size: 11px;
    color: var(--text-caption);
    font-family: var(--font-mono);
}

.toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-primary);
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1.4;
    user-select: none;
}

.toggle-btn:hover {
    background: rgba(22, 119, 255, 0.12);
    border-color: rgba(22, 119, 255, 0.35);
    color: var(--color-primary-hover);
}

.toggle-btn:active {
    transform: translateY(0.5px);
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
    transition: opacity 0.2s ease;
}

.records-list.collapsed {
    display: none;
}

.record-row {
    display: grid;
    grid-template-columns: 32px 1fr auto 110px auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--page-bg);
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.record-row:hover {
    background: #eef2f7;
}

/* 查看证据按钮 */
.evidence-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
    user-select: none;
}
.evidence-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary-border);
    background: var(--color-primary-bg);
}
.evidence-btn .ev-count {
    margin-left: 5px;
    padding: 1px 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: var(--color-primary);
    border-radius: 10px;
    line-height: 1.3;
}
.evidence-btn:hover .ev-count {
    background: var(--color-primary-hover);
}

.record-remark {
    grid-column: 2 / -1;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: -2px;
    margin-bottom: -2px;
    line-height: 1.5;
}
.record-remark::before {
    content: "备注：";
    color: var(--text-caption);
    font-weight: 500;
}

.record-index {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-caption);
    font-weight: 600;
    text-align: center;
}

.record-amount {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-danger);
}
.record-amount.amount-medium { color: #d48806; }
.record-amount.amount-small  { color: #389e0d; }

.record-tag {
    display: inline-block;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    background: rgba(255, 77, 79, 0.08);
    color: var(--color-danger);
    border: 1px solid rgba(255, 77, 79, 0.15);
}
.record-tag.amount-medium {
    background: rgba(250, 173, 20, 0.08);
    color: #d48806;
    border-color: rgba(250, 173, 20, 0.2);
}
.record-tag.amount-small {
    background: rgba(82, 196, 26, 0.08);
    color: #389e0d;
    border-color: rgba(82, 196, 26, 0.2);
}

.record-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: right;
}

/* 无记录 */
.records-empty {
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-caption);
}

/* ========== Empty State ========== */
.empty {
    padding: 80px 20px;
    text-align: center;
    color: var(--text-tertiary);
    grid-column: 1 / -1;
}
.empty-title {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}
.empty-desc {
    font-size: 13px;
    color: var(--text-caption);
}

.error-state {
    padding: 60px 24px;
    text-align: center;
    grid-column: 1 / -1;
}
.error-title {
    font-size: 15px;
    color: var(--color-danger);
    margin-bottom: 8px;
    font-weight: 600;
}
.error-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.7;
}

/* ========== Search ========== */
.search-section {
    padding: 0 0 20px;
}

.search-toolbar {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    box-shadow:
        0 1px 2px 0 rgba(0, 0, 0, 0.03),
        0 4px 12px -4px rgba(22, 119, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    overflow: hidden;
}

/* 工具条左侧品牌色装饰条 */
.search-toolbar::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--color-primary) 0%, rgba(22, 119, 255, 0.3) 100%);
}

.search-box {
    flex: 1 1 320px;
    min-width: 240px;
    position: relative;
    display: flex;
    align-items: center;
    background: #f7f9fc;
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: all 0.2s ease;
    height: 44px;
    padding: 0 6px 0 18px;
}

.search-box:hover {
    background: #fff;
    border-color: #c0c4cc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.search-box:focus-within {
    background: #fff;
    border-color: var(--color-primary);
    box-shadow:
        0 0 0 4px rgba(22, 119, 255, 0.1),
        0 2px 8px rgba(22, 119, 255, 0.12);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-caption);
    flex-shrink: 0;
    margin-right: 12px;
    transition: color 0.2s ease;
}

.search-box:focus-within .search-icon {
    color: var(--color-primary);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    line-height: 44px;
    height: 100%;
    padding: 0;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-caption);
}

.search-clear {
    border: none;
    background: var(--border-light);
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    margin-left: 6px;
    flex-shrink: 0;
}
.search-clear:hover {
    background: var(--color-danger);
    color: #fff;
    transform: rotate(90deg);
}

.search-summary {
    font-size: 13px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    padding: 6px 12px;
    background: var(--color-primary-bg);
    border: 1px solid var(--color-primary-border);
    border-radius: 999px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.search-summary strong {
    color: var(--color-primary);
    font-weight: 700;
    margin: 0 2px;
    font-family: var(--font-mono);
}
.search-summary .no-match {
    color: var(--color-danger);
}

/* ========== Footer ========== */
.site-footer {
    width: 100%;
    margin-top: auto;
    background: linear-gradient(180deg, #f5f7fa 0%, #e8ecf1 100%);
    border-top: 1px solid #e5e7eb;
    position: relative;
}

.footer-top {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px 32px;
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

.footer-brand-area {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
}

.footer-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1677ff, #4096ff);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.25);
}

.footer-brand-text {
    padding-top: 2px;
}

.footer-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.footer-subtitle {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

.footer-links {
    display: flex;
    gap: 56px;
    margin-left: auto;
}

.footer-links-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.footer-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s ease;
    line-height: 1.5;
}

.footer-link:hover {
    color: #1677ff;
}

.footer-bottom {
    border-top: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.5);
}

.footer-bottom-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #9ca3af;
    flex-wrap: wrap;
}

.footer-dot {
    color: #d1d5db;
}

@media (max-width: 768px) {
    .footer-top {
        flex-direction: column;
        gap: 28px;
        padding: 32px 20px 24px;
    }
    .footer-links {
        gap: 32px;
    }
    .footer-bottom-inner {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
    .footer-dot { display: none; }
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.records-list::-webkit-scrollbar { width: 4px; }
.records-list::-webkit-scrollbar-thumb { background: #e5e7eb; }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .user-grid { grid-template-columns: 1fr; }
    .content-layout { flex-direction: column; }
    .content-sidebar { width: 100%; position: static; }
    .side-ads { display: none !important; }
    body { padding-left: 0 !important; padding-right: 0 !important; }
}

/* body padding 由 JS updateBodyPadding() 动态控制，避免无广告时出现空白 */
@media (min-width: 1440px) {
    .container { max-width: 1280px; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 22px; }

    .site-header-inner { padding: 16px 0; }
    .brand-title { font-size: 18px; }
    .site-desc, .site-meta { padding-left: 0; }
    .brand-mark { width: 36px; height: 36px; font-size: 14px; }

    .header-row {
        flex-wrap: wrap;
    }
    .user-total {
        width: 100%;
        padding-left: 50px;
        text-align: left;
        margin-top: 8px;
    }
    .total-amount { font-size: 22px; }

    .record-row {
        grid-template-columns: 28px 1fr;
        grid-auto-rows: auto;
    }
    .record-row .record-tag,
    .record-row .record-date,
    .record-row .evidence-btn {
        grid-column: 2 / -1;
    }
    .record-date {
        text-align: left;
        padding: 0;
        margin: -4px 0 -2px;
        font-size: 11px;
    }
    .evidence-btn {
        justify-self: start;
        margin-top: -2px;
    }
    .record-remark {
        grid-column: 2 / -1;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .user-card-header { padding: 16px; }
    .records { padding: 12px 16px 16px; }
    .search-toolbar { padding: 12px; gap: 10px; }
    .search-summary { font-size: 12px; }
}

/* ========== 证据查看灯箱 ========== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.lightbox.open { display: flex; }

.lightbox-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    cursor: zoom-out;
}

.lightbox-panel {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 1080px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lightbox-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    background: #fafbfc;
}

.lightbox-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.lightbox-meta {
    font-size: 13px;
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.lightbox-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.lightbox-meta .meta-key {
    color: var(--text-caption);
    font-size: 12px;
}
.lightbox-meta .meta-amount {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--color-danger);
    font-size: 14px;
}
.lightbox-meta .meta-user { font-weight: 600; color: var(--text-primary); }

.lightbox-close {
    position: absolute;
    top: 14px;
    right: 16px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s ease;
}
.lightbox-close:hover {
    background: var(--page-bg);
    color: var(--text-primary);
}

.lightbox-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
    background: var(--page-bg);
}

/* 图片网格 */
.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.evidence-grid.empty {
    grid-template-columns: 1fr;
}
.evidence-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    font-size: 13px;
}

.evidence-item {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}
.evidence-item:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    border-color: var(--border);
}

.evidence-thumb {
    position: relative;
    background: #f0f2f5;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: block;
    text-decoration: none;
}
.evidence-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.evidence-item:hover .evidence-thumb img {
    transform: scale(1.03);
}

.evidence-caption {
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid var(--border-light);
    background: #fafbfc;
}
.evidence-caption .evidence-name {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}
.evidence-caption .evidence-idx {
    flex-shrink: 0;
    color: var(--text-caption);
}

/* 灯箱移动端 */
@media (max-width: 768px) {
    .lightbox { padding: 0; }
    .lightbox-panel {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    .lightbox-header { padding: 16px 20px; }
    .lightbox-meta { gap: 8px; font-size: 12px; }
    .lightbox-body { padding: 16px; }
    .evidence-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .lightbox-close { top: 10px; right: 12px; }
}
@media (max-width: 480px) {
    .evidence-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* 禁止页面滚动（灯箱打开时） */
body.lightbox-open {
    overflow: hidden;
}
