/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --brand: #e96b8a;
    --brand-dark: #d4506e;
    --ink: #2f3542;
    --muted: #8a94a6;
    --line: #eceef3;
    --bg: #f6f4f7;
    --paper: #fffdfa;
    --shadow: 0 8px 30px rgba(60,40,80,.10);
}
body { font-family: "PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
    background: var(--bg); color: var(--ink); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== 导航 ===== */
.navbar { background: linear-gradient(135deg,#e96b8a,#d4506e); color: #fff;
    box-shadow: 0 2px 12px rgba(212,80,110,.25); position: sticky; top: 0; z-index: 50; }
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; gap: 24px; height: 58px; }
.brand { color: #fff; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.nav-links { display: flex; gap: 6px; flex: 1; }
.nav-links a { color: rgba(255,255,255,.9); padding: 6px 12px; border-radius: 6px; font-size: 15px; }
.nav-links a:hover { background: rgba(255,255,255,.18); text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 14px; opacity: .95; }
.btn-logout { background: rgba(255,255,255,.2); color: #fff; border: none;
    padding: 5px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; }
.btn-logout:hover { background: rgba(255,255,255,.35); }

/* ===== 通用容器 ===== */
.container { max-width: 1080px; margin: 28px auto; padding: 0 20px 60px; }
h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.muted { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.muted b { color: var(--brand-dark); }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 14px;
    padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }

/* ===== 按钮 ===== */
.btn { display: inline-block; padding: 9px 20px; border: none; border-radius: 8px;
    font-size: 15px; cursor: pointer; transition: .15s; text-decoration: none; line-height: 1.4; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-danger { background: #fff; color: #d44; border: 1px solid #f5c2c2; }
.btn-danger:hover { background: #d44; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; padding: 12px; font-size: 16px; }

/* ===== 表单 ===== */
.form-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.form-row.three > * { flex: 1 1 180px; }
.form-label { display: flex; flex-direction: column; gap: 6px; font-size: 14px;
    font-weight: 600; color: var(--ink); flex: 1 1 200px; }
.form-label input, .form-label select, .form-label textarea {
    font-weight: 400; padding: 9px 12px; border: 1px solid #d8dce4; border-radius: 8px;
    font-size: 15px; background: #fbfbfc; transition: .15s; }
.form-label input:focus, .form-label select:focus, .form-label textarea:focus {
    outline: none; border-color: var(--brand); background: #fff;
    box-shadow: 0 0 0 3px rgba(233,107,138,.12); }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.form-actions { display: flex; gap: 12px; margin-top: 22px; }

/* ===== 提示 ===== */
.alert { padding: 11px 15px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-info { background: #eef4ff; color: #2a5bd0; border: 1px solid #d6e4ff; }
.alert-error { background: #fff0f0; color: #c33; border: 1px solid #ffd6d6; }
.alert-success { background: #eefaf0; color: #1a9e4f; border: 1px solid #c8f0d4; }

/* ===== 拖拽上传 ===== */
.dropzone { border: 2px dashed #e0a6b4; border-radius: 12px; padding: 34px 20px;
    text-align: center; background: #fdf6f8; color: var(--ink); cursor: pointer;
    transition: .15s; margin-top: 6px; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: #fdeef2; }
.dropzone p { font-size: 15px; }
.link-btn { background: none; border: none; color: var(--brand-dark); cursor: pointer;
    font-size: 15px; text-decoration: underline; }
.file-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.file-item { display: grid; grid-template-columns: 56px 1fr 140px 1fr auto;
    gap: 12px; align-items: center; background: #fbfbfc; border: 1px solid var(--line);
    border-radius: 10px; padding: 10px 14px; }
.file-item .thumb-sm { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.file-item .fname { font-size: 13px; color: var(--muted); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
.file-item input { padding: 7px 10px; border: 1px solid #d8dce4; border-radius: 6px; font-size: 14px; }
.file-item .remove { background: none; border: none; color: #c66; cursor: pointer; font-size: 18px; }

/* ===== 书本 ===== */
.book-container { max-width: 860px; }
.book-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; font-size: 14px; color: var(--muted); }
.progress-bar { flex: 1; height: 6px; background: #eee; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg,#e96b8a,#f0a0b0); transition: width .3s; }
.page { position: relative; background: var(--paper); border-radius: 14px;
    box-shadow: var(--shadow), 0 0 0 1px var(--line); padding: 38px 42px 30px;
    min-height: 460px; }
.page::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
    background: linear-gradient(180deg,transparent,#eadfdf,transparent); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start;
    border-bottom: 2px solid #f0e6e9; padding-bottom: 14px; margin-bottom: 18px; }
.page-date { display: flex; flex-direction: column; }
.page-date .weekday { font-size: 14px; color: var(--brand-dark); font-weight: 600; letter-spacing: 1px; }
.page-date .fulldate { font-size: 26px; font-weight: 700; color: var(--ink); }
.page-gest { background: #fdeef2; color: var(--brand-dark); padding: 6px 16px;
    border-radius: 20px; font-size: 14px; font-weight: 600; }
.page-notes { background: #fdf6f8; border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0;
    padding: 12px 16px; margin-bottom: 20px; font-size: 14px; }
.note-tag { display: block; font-size: 12px; color: var(--brand-dark); font-weight: 600; margin-bottom: 4px; }
.page-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.report { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
    transition: .18s; }
.report:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(60,40,80,.14); }
.report img { width: 100%; height: 200px; object-fit: contain; background: #fafafa; cursor: zoom-in; }
.img-broken { padding: 40px; text-align: center; color: var(--muted); font-size: 14px; }
.report figcaption { padding: 9px 12px; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.ftype { background: #fdeef2; color: var(--brand-dark); padding: 2px 9px; border-radius: 12px;
    font-size: 12px; font-weight: 600; white-space: nowrap; }
.fdesc { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-foot { text-align: right; font-size: 12px; color: var(--muted); margin-top: 16px;
    border-top: 1px solid var(--line); padding-top: 10px; }

/* 翻页 */
.book-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 26px; }
.btn-page { padding: 11px 26px; background: #fff; color: var(--ink); border: 1px solid var(--line);
    border-radius: 30px; font-size: 15px; cursor: pointer; box-shadow: var(--shadow); transition: .15s; }
.btn-page:hover { border-color: var(--brand); color: var(--brand-dark); text-decoration: none; }
.btn-page.disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-page.disabled:hover { border-color: var(--line); color: var(--ink); }
.page-indicator { font-size: 15px; color: var(--muted); min-width: 60px; text-align: center; }

/* ===== 搜索 ===== */
.search-form { margin-bottom: 28px; }
.result-summary { display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; font-size: 15px; font-weight: 600; }
.result-card { background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow); transition: .15s; }
.result-card:hover { border-color: var(--brand); }
.result-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.result-date { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; color: var(--ink); }
.result-date .dow { color: var(--brand-dark); font-size: 13px; }
.chip { background: #f0f2f6; color: #556; padding: 3px 11px; border-radius: 14px; font-size: 12px; }
.count-chip { background: #fdeef2; color: var(--brand-dark); }
.result-notes { font-size: 14px; color: #556; background: #fbfbfc; border-radius: 6px;
    padding: 8px 12px; margin-bottom: 10px; }
.result-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ftype-tag { font-size: 12px; background: #fdeef2; color: var(--brand-dark); padding: 3px 10px;
    border-radius: 12px; }
.ftype-tag em { font-style: normal; color: var(--muted); margin-left: 4px; }
.result-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.thumb { width: 90px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* ===== 管理 ===== */
.stats { display: flex; gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 26px;
    box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; }
.stat b { font-size: 26px; color: var(--brand-dark); }
.stat span { font-size: 13px; color: var(--muted); }
.manage-day { background: #fff; border: 1px solid var(--line); border-radius: 10px;
    margin-bottom: 10px; overflow: hidden; }
.manage-day summary { padding: 14px 18px; cursor: pointer; display: flex; align-items: center;
    gap: 10px; flex-wrap: wrap; list-style: none; }
.manage-day summary::-webkit-details-marker { display: none; }
.manage-day summary::before { content: "▶"; color: var(--brand); font-size: 11px; }
.manage-day[open] summary::before { content: "▼"; }
.manage-files { padding: 6px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.manage-file { display: grid; grid-template-columns: 70px 1fr auto; gap: 14px; align-items: center;
    background: #fbfbfc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.thumb-link .thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.file-meta { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.file-meta .fname { font-size: 13px; color: var(--muted); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }

/* ===== 空状态 ===== */
.empty, .empty-small { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); margin: 12px 0 8px; }
.empty .btn { margin-top: 16px; }
.empty-icon { font-size: 54px; }

/* ===== 登录页 ===== */
.auth-body { background: linear-gradient(135deg,#fbe9ee,#f4ecf7); min-height: 100vh;
    display: flex; align-items: center; justify-content: center; }
.auth-card { background: #fff; width: 100%; max-width: 400px; border-radius: 16px;
    padding: 38px 34px; box-shadow: 0 12px 40px rgba(80,50,80,.14); }
.auth-brand { font-size: 22px; font-weight: 700; color: var(--brand-dark); text-align: center; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 24px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.auth-form input { font-weight: 400; padding: 10px 13px; border: 1px solid #d8dce4;
    border-radius: 8px; font-size: 15px; }
.auth-form input:focus { outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(233,107,138,.12); }
.auth-foot { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }

/* ===== 页脚 ===== */
.footer { border-top: 1px solid var(--line); background: #fff; padding: 18px 20px; margin-top: 40px; }
.foot-inner { max-width: 1080px; margin: 0 auto; font-size: 12px; color: var(--muted); text-align: center; }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
    .container { margin: 18px auto; padding: 0 14px 36px; }
    h1 { font-size: 21px; }
    .navbar { position: static; }
    .nav-inner { height: auto; min-height: 58px; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
    .brand { width: 100%; }
    .nav-links { width: 100%; order: 3; overflow-x: auto; gap: 2px; }
    .nav-links a { white-space: nowrap; padding: 7px 9px; font-size: 13px; }
    .nav-user { position: absolute; right: 14px; top: 12px; }
    .user-name { display: none; }
    .form-card { padding: 17px 14px; }
    .form-row, .form-row.three { flex-direction: column; gap: 14px; }
    .form-label { min-width: 0; }
    .form-label input, .form-label select, .form-label textarea { width: 100%; min-height: 44px; font-size: 16px; }
    .file-item { grid-template-columns: 1fr; padding: 12px; }
    .file-item .thumb-sm { width: 72px; height: 72px; }
    .file-item input, .file-item .remove { grid-column: 2; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .btn { flex: 1 1 135px; text-align: center; }
    .page { padding: 22px 16px; min-height: 0; }
    .page::before { display: none; }
    .page-date .fulldate { font-size: 21px; }
    .page-files { grid-template-columns: 1fr; }
    .report img { height: auto; max-height: 65vh; min-height: 180px; }
    .book-progress { align-items: flex-start; flex-direction: column; gap: 6px; }
    .progress-bar { width: 100%; flex: none; }
    .book-nav { gap: 8px; }
    .btn-page { padding: 10px 12px; font-size: 13px; text-align: center; }
    .result-summary { align-items: flex-start; gap: 10px; flex-wrap: wrap; }
    .result-card { padding: 14px; }
    .result-date { font-size: 16px; }
    .stats { gap: 8px; }
    .stat { flex: 1; padding: 12px; }
    .manage-file { grid-template-columns: 54px 1fr; gap: 10px; padding: 10px; }
    .manage-file form { grid-column: 1 / -1; }
    .manage-file form .btn { width: 100%; }
    .manage-day summary { padding: 12px; }
    .manage-files { padding: 4px 10px 12px; }
    .auth-card { width: calc(100% - 28px); padding: 28px 20px; }
    .footer { margin-top: 24px; padding: 14px; }
}

.type-filter { max-width: 320px; margin: 0 0 20px; }
.single-report { grid-template-columns: minmax(0, 1fr); }
.single-report .report { max-width: 760px; margin: 0 auto; width: 100%; }
.single-report .report img { height: auto; max-height: 72vh; min-height: 260px; }
.pdf-viewer { width: 100%; max-width: 760px; margin: 0 auto; }
.pdf-toolbar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pdf-page-count { min-width: 70px; text-align: center; font-size: 13px; color: var(--muted); }
.pdf-canvas-wrap { overflow: auto; text-align: center; background: #f4f3f2; border: 1px solid var(--line); }
.pdf-canvas { display: block; max-width: 100%; height: auto; margin: 0 auto; background: #fff; }
.pdf-error { margin-top: 10px; color: #a33; text-align: center; font-size: 13px; }
.pdf-viewer-page { max-width: 100%; }
.pdf-viewer-page .pdf-canvas-wrap { min-height: 60vh; }

/* 简洁主题：减少装饰，突出内容和操作 */
:root {
    --brand: #b96d7b;
    --brand-dark: #985565;
    --ink: #343238;
    --muted: #85818a;
    --line: #e9e6e7;
    --bg: #f8f7f6;
    --paper: #fff;
    --shadow: none;
}
body { background: var(--bg); line-height: 1.6; }
a { color: var(--brand-dark); }
.navbar { background: #fff; color: var(--ink); box-shadow: none; border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 1120px; height: 60px; gap: 28px; }
.brand { color: var(--ink); font-size: 17px; letter-spacing: 0; }
.nav-links { gap: 4px; }
.nav-links a { color: #65616a; border-radius: 6px; padding: 7px 10px; font-size: 14px; }
.nav-links a:hover { color: var(--brand-dark); background: #f7f3f4; }
.btn-logout { background: #f5f3f3; color: #5d5860; border: 1px solid var(--line); border-radius: 6px; }
.btn-logout:hover { background: #eeebec; }
.container { margin-top: 32px; }
h1 { font-size: 23px; font-weight: 650; margin-bottom: 12px; }
.form-card, .result-card, .stat, .page, .auth-card { box-shadow: none; border-radius: 9px; }
.form-card { border-color: var(--line); padding: 22px; }
.btn { border-radius: 6px; }
.btn-primary { background: #a85f70; }
.btn-primary:hover { background: #914d5d; }
.btn-ghost { border-color: #dedadc; }
.form-label input, .form-label select, .form-label textarea, .auth-form input {
    background: #fff; border-color: #dedadc; border-radius: 6px;
}
.form-label input:focus, .form-label select:focus, .form-label textarea:focus, .auth-form input:focus {
    border-color: var(--brand); box-shadow: 0 0 0 2px rgba(185,109,123,.12);
}
.dropzone { background: #fbf9f9; border: 1px dashed #d8c8cc; border-radius: 8px; }
.dropzone:hover, .dropzone.drag { background: #f8f2f3; border-color: var(--brand); }
.file-item, .manage-file { background: #fff; border-radius: 7px; }
.progress-bar { background: #eae7e8; }
.progress-fill { background: var(--brand); }
.page { border-radius: 9px; padding: 32px; }
.page::before { display: none; }
.page-head { border-bottom-width: 1px; border-color: var(--line); }
.page-date .weekday { color: var(--muted); letter-spacing: 0; }
.page-date .fulldate { font-size: 24px; }
.report { border-color: var(--line); border-radius: 7px; }
.report:hover { transform: none; box-shadow: none; }
.ftype, .count-chip { background: #f4edef; color: var(--brand-dark); }
.btn-page { border-radius: 6px; box-shadow: none; }
.result-card { border-radius: 8px; box-shadow: none; }
.result-card:hover { border-color: #d8c8cc; }
.chip { border-radius: 5px; }
.manage-day { border-radius: 8px; }
.manage-day summary::before { color: #9c969b; }
.auth-body { background: #f7f6f5; }
.auth-card { border: 1px solid var(--line); padding: 34px; }
.auth-brand { color: var(--ink); font-size: 20px; }
.footer { background: transparent; border-color: var(--line); }
.empty-icon { font-size: 36px; }

@media (max-width: 640px) {
    .nav-inner { gap: 8px; }
    .brand { width: auto; }
    .nav-links a { color: #65616a; }
    .container { margin-top: 22px; }
    .form-card { padding: 17px 14px; }
    .page { padding: 20px 15px; }
    .page-date .fulldate { font-size: 20px; }
    .auth-card { padding: 26px 20px; }
}
