:root {
    --text-primary: #1f2329;
    --text-secondary: #646a73;
    --text-tertiary: #8f959e;
    --border: #e8eaed;
    --bg-page: #f5f6f7;
    --bg-card: #ffffff;
    --accent: #1677ff;
    --accent-hover: #0e5fd8;
    --warn-bg: #fff7e6;
    --warn-border: #ffe4ba;
    --warn-text: #b25e09;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 24px;
}

/* 头部 */
.page-header { text-align: center; margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 600; }
.page-subtitle { margin-top: 6px; color: var(--text-secondary); font-size: 14px; }

/* 未登录卡片 */
.login-view { display: flex; justify-content: center; padding: 40px 0; }
.login-card {
    width: 100%;
    max-width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px;
    text-align: center;
    box-shadow: 0 6px 24px rgba(31, 35, 41, .06);
}
.login-icon { font-size: 40px; line-height: 1; }
.login-title { font-size: 18px; font-weight: 600; margin-top: 16px; }
.login-desc { margin-top: 8px; color: var(--text-secondary); font-size: 14px; }
.login-card .btn { margin-top: 24px; width: 100%; }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    padding: 10px 22px;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-download {
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 13px;
    padding: 7px 16px;
    border-radius: 8px;
}
.btn-download:hover { background: rgba(22, 119, 255, .06); }
.btn-download[disabled] { opacity: .6; cursor: not-allowed; }

/* 状态提示 */
.status-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}
.status-error { color: #d9480f; }
.status-error a { color: inherit; font-weight: 600; cursor: pointer; }

/* 文件分组 */
.file-groups { display: flex; flex-direction: column; gap: 16px; }
.file-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: .02em;
    padding: 12px 18px 6px;
}
.file-list { list-style: none; }

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
}
.file-item + .file-item { border-top: 1px solid var(--border); }
.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.file-name {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-meta { font-size: 12px; color: var(--text-tertiary); }

/* 底部提醒 */
.page-footer {
    margin-top: auto;
    padding: 14px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--warn-text);
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-radius: 10px;
}

@media (max-width: 480px) {
    .page { padding: 24px 14px 16px; }
    .file-item { padding: 12px 14px; }
    .file-name { font-size: 14px; }
}
