/* 公共列表页面样式 - 极简版 */
:root {
    --bg-gradient: #fafafa;
    --bg-pattern: none;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --table-bg: #ffffff;
    --even-row: #f5f5f5;
    --hover: #ebebeb;
    --header-bg: #333333;
    --header-text: #ffffff;
    --border: #e0e0e0;
    --accent: #1a1a1a;
    --accent-light: #f0f0f0;
    --shadow-color: rgba(0, 0, 0, 0.08);
}

/* 手动dark模式 */
html.dark {
    --bg-gradient: #121212;
    --bg-pattern: none;
    --text-primary: #e0e0e0;
    --text-secondary: #999999;
    --table-bg: #1e1e1e;
    --even-row: #252525;
    --hover: #2a2a2a;
    --header-bg: #dddddd;
    --header-text: #121212;
    --border: #333333;
    --accent: #e0e0e0;
    --accent-light: #252525;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-gradient: #121212;
        --bg-pattern: none;
        --text-primary: #e0e0e0;
        --text-secondary: #999999;
        --table-bg: #1e1e1e;
        --even-row: #252525;
        --hover: #2a2a2a;
        --header-bg: #dddddd;
        --header-text: #121212;
        --border: #333333;
        --accent: #e0e0e0;
        --accent-light: #252525;
        --shadow-color: rgba(0, 0, 0, 0.3);
    }
}

/* 清单页导航条 */
.list-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.list-nav-back {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.list-nav-back:hover {
    color: var(--text-primary);
}

.list-nav-links {
    display: flex;
    gap: 20px;
}

.list-nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.list-nav-links a:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .list-nav {
        padding: 10px 10px;
        font-size: 0.9rem;
    }
    .list-nav-links {
        gap: 14px;
    }
}

body {
    font-family: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    margin: 0;
    padding: 20px 10px;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* 标题区域 */
.title {
    text-align: center;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 800;
    margin: 40px 0 12px;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.subtitle {
    text-align: center;
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin: 0 0 20px;
    font-style: italic;
    letter-spacing: 1px;
}

.stats {
    text-align: center;
    color: var(--text-secondary);
    margin: 0 0 36px;
    font-size: 1rem;
    display: block;
    width: fit-content;
    padding: 8px 24px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.stats strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* 表格样式 */
table {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 60px;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--table-bg);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px var(--shadow-color);
    table-layout: auto;
}

caption {
    caption-side: top;
    padding: 24px 0 16px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--accent-light);
    border-bottom: 1px solid var(--border);
}

/* 表头 */
th {
    background: var(--header-bg);
    color: var(--header-text);
    font-weight: 600;
    padding: 16px 14px;
    text-align: left;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.2s ease;
    letter-spacing: 0.5px;
    white-space: nowrap !important;
}

th:hover {
    opacity: 0.85;
}

th.sorted-asc::before {
    content: "▲ ";
    font-size: 0.7em;
    margin-right: 4px;
}

th.sorted-desc::before {
    content: "▼ ";
    font-size: 0.7em;
    margin-right: 4px;
}

th:first-child,
td:first-child {
    text-align: center;
    width: 70px;
}

/* 表格内容 */
td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    transition: background 0.2s ease;
    white-space: nowrap !important;
}

tr:last-child td {
    border-bottom: none;
}

/* 链接样式 */
td a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

td a:hover {
    opacity: 0.7;
}

/* 行样式 */
tr:nth-child(even) {
    background-color: var(--even-row);
}

tr:hover {
    background: var(--hover);
}

/* 删除线样式（用于心愿单） */
.strike td,
.strike td * {
    color: var(--text-secondary);
    opacity: 0.5;
}

.strike {
    background-color: var(--accent-light);
}

/* 总计区域（用于心愿单） */
.totals {
    max-width: 1100px;
    margin: 0 auto 60px;
    padding: 20px 24px;
    line-height: 2;
    font-size: 1.1rem;
    color: var(--text-primary);
    background: var(--table-bg);
    border-radius: 4px;
    box-shadow: 0 1px 3px var(--shadow-color);
    border: 1px solid var(--border);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 4px;
    background: var(--header-bg);
    color: var(--header-text);
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 1px 3px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    opacity: 0.8;
}

/* 手机端卡片式布局 */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .subtitle {
        font-size: 1rem;
    }

    .stats {
        font-size: 0.9rem;
        padding: 6px 18px;
    }

    .table-container {
        max-width: 100%;
    }

    table {
        margin-bottom: 20px;
        border-radius: 4px;
    }

    caption {
        font-size: 1.3rem;
        padding: 18px 0 12px;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        display: none;
    }

    tr {
        margin-bottom: 16px;
        border-radius: 4px;
        box-shadow: 0 1px 3px var(--shadow-color);
        background: var(--table-bg);
        overflow: hidden;
        border: 1px solid var(--border);
    }

    td {
        position: relative;
        padding: 14px 14px 14px 85px;
        min-height: 48px;
        border: none;
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
    }

    td:last-child {
        border-bottom: none;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        width: 65px;
        white-space: nowrap;
        font-weight: 700;
        color: var(--accent);
        font-size: 0.9em;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        border-radius: 4px;
    }

    .totals {
        margin: 0 0 20px;
        border-radius: 4px;
    }
}

/* 阅读状态标记 */
.status-abandoned {
    color: var(--text-secondary);
    font-style: italic;
}
