/* ============================================
   Kun's Notes — Financial Times 风格
   粉白背景 / 衬线标题 / 品牌红强调 / 报纸排版
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --pink-bg: #FFF1E5;      /* FT 标志粉白背景 */
  --card: #FFF8F2;         /* 卡片略亮 */
  --ink: #1C1C1C;          /* 近黑标题 */
  --muted: #6B6B6B;        /* 灰色小字 */
  --line: #E8DFD3;         /* 细分隔线 */
  --accent: #D05C40;       /* FT 品牌红 (crimson) */
  --accent-dark: #B14A33;
  --accent-soft: #FFDED2;  /* 浅橙粉 */
  --radius: 4px;
  --serif: "Cormorant Garamond", "华文仿宋", "STFangsong", "仿宋", FangSong, "Noto Serif SC", Georgia, "Times New Roman", serif;
  --sans: -apple-system, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
body { font-family: var(--serif); background: var(--pink-bg); color: var(--ink); line-height: 1.65; }
input, button, select, textarea { font-family: inherit; }
.container { max-width: 1020px; margin: 0 auto; padding: 0 22px; }

/* 顶栏：顶部红色细线 + 白底 */
.topbar { background: #fff; border-bottom: 1px solid var(--line); border-top: 3px solid var(--accent); position: sticky; top: 0; z-index: 50; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-size: 24px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: 2px; }
.brand-serif { font-family: var(--serif); font-weight: 700; }
.nav { display: flex; gap: 24px; }
.nav-link { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; padding: 6px 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.nav-link:hover { color: var(--accent); }
.nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-link { color: var(--accent); text-decoration: none; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; border: 1px solid var(--accent); padding: 5px 14px; border-radius: 3px; transition: all .15s; }
.admin-link:hover { background: var(--accent); color: #fff; }
.admin-group { display: flex; gap: 10px; align-items: center; }

/* 主区 */
main.container { padding: 36px 22px 70px; min-height: calc(100vh - 190px); }

/* 通用卡片：平面报纸感 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.section-title { font-size: 14px; font-weight: 700; margin: 38px 0 16px; color: var(--accent); text-transform: uppercase; letter-spacing: 1.2px; display: flex; align-items: baseline; gap: 10px; }
.section-title small { font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }
.more-link { font-size: 13px; color: var(--accent); text-decoration: none; }
.more-link:hover { text-decoration: underline; }

/* Hero：FT 式大标题 */
.hero { text-align: center; padding: 52px 20px 26px; }
.hero h1 { font-family: var(--serif); font-size: 46px; font-weight: 700; letter-spacing: 2px; color: var(--ink); }
.hero p { color: var(--muted); margin-top: 12px; font-size: 15px; }
.hero-stats { display: flex; justify-content: center; gap: 48px; margin-top: 30px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat b { display: block; font-size: 28px; color: var(--accent); font-family: var(--serif); font-weight: 700; }
.hero-stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }

/* 网格 */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* 文章卡片：报纸标题 + 时间 + 图片 + 摘要 */
.article-card { border-top: 3px solid var(--accent); display: block; text-decoration: none; overflow: hidden; padding: 0; color: var(--ink); }
.article-card:hover { border-color: var(--accent); }
.ac-cover { height: 150px; overflow: hidden; }
.ac-cover img { width: 100%; height: 150px; object-fit: cover; display: block; }
.ac-body { padding: 14px 16px 16px; }
.ac-body h3 { font-size: 18px; font-family: var(--serif); font-weight: 700; line-height: 1.35; margin-bottom: 6px; }
.ac-body h3 a { color: var(--ink); text-decoration: none; }
.ac-body h3 a:hover { color: var(--accent); }
.ac-body .meta { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.ac-summary { color: var(--muted); font-size: 13px; margin-top: 0; line-height: 1.62; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--serif); }
.article-cover { width: 100%; height: 170px; object-fit: cover; border-radius: 3px; margin-bottom: 12px; display: block; }
.article-full h1 { font-size: 34px; margin-bottom: 12px; font-family: var(--serif); font-weight: 800; line-height: 1.25; }
.article-full .meta { color: var(--muted); font-size: 13px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.article-body { font-size: 16px; color: #333; }

/* 相册 */
.photo-card { border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); }

/* ===== Home 今日概览 ===== */
.home-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); margin-bottom: 24px; }
@media (max-width: 700px) { .home-grid { grid-template-columns: 1fr; } }
.home-card h3 { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.home-card h3 small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.home-stats { display: flex; gap: 20px; margin-bottom: 6px; }
.hs-item .hs-v { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--accent); }
.hs-item .hs-v small { font-size: 13px; color: var(--muted); font-weight: 400; }
.hs-item .hs-l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hs-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink); margin: 7px 0 4px; }
.hs-line b { color: var(--accent); font-family: var(--serif); }
.hs-bar { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.hs-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.hs-bar.p i { background: #2F7D5B; }
.hs-bar.c i { background: #3A6EA8; }
.hs-bar.f i { background: #C26A2B; }
.home-note { font-size: 12px; color: var(--muted); margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }

/* ===== GROCERYS 文件柜 ===== */
.gr-upload { display: inline-block; }
.gr-input { display: none; }
.gr-list { display: grid; gap: 8px; }
.gr-item { display: flex; align-items: center; gap: 12px; background: #FFFDF9; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; }
.gr-icon { color: var(--accent); font-size: 16px; flex: none; }
.gr-info { flex: 1; min-width: 0; }
.gr-name { font-family: var(--serif); font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.gr-tools { flex: none; display: flex; gap: 6px; align-items: center; }
.gr-tools form { display: inline; }

/* ===== Moments（朋友圈） ===== */
.mm-headbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.mm-headbar .section-title { margin-bottom: 0; }
.mm-list { max-width: 640px; }
.mm-item { background: #FFFDF9; border: 1px solid var(--line); border-radius: 6px; padding: 14px 14px 12px; margin-bottom: 16px; }
.mm-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.mm-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 700; font-size: 18px; flex: none; }
.mm-info { flex: 1; min-width: 0; }
.mm-name { font-weight: 700; font-family: var(--serif); font-size: 14px; color: var(--ink); }
.mm-time { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mm-del { flex: none; }
.mm-content { font-size: 14px; color: var(--ink); line-height: 1.6; margin: 6px 0 10px 52px; white-space: pre-wrap; word-break: break-word; }
/* 朋友圈图片网格：整体区域宽度固定（最大 350px），行高 = 1/3 区域宽 */
.mm-grid { display: grid; gap: 6px; width: 100%; max-width: 350px; }
.mm-grid .mm-row { display: grid; gap: 6px; aspect-ratio: 3 / 1; }
.mm-grid .mm-row.r2 { grid-template-columns: repeat(2, 1fr); }
.mm-grid .mm-row.r3 { grid-template-columns: repeat(3, 1fr); }
/* 2/4 张：行高 = 格宽（正方形），4 张总面积与 9 张一致 */
.mm-grid.mm-sqrow .mm-row { aspect-ratio: 2 / 1; }
.mm-grid .mm-ph { position: relative; overflow: hidden; border-radius: 3px; }
.mm-grid .mm-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 单图：区域 = 3x3 同等面积的正方形，原比例裁剪填充 */
.mm-grid.mm-single { aspect-ratio: 1 / 1; }
.mm-grid.mm-single .mm-ph { width: 100%; height: 100%; }
.mm-dl { position: absolute; right: 5px; bottom: 5px; background: rgba(0,0,0,.45); color: #fff; width: 24px; height: 24px; border-radius: 4px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 14px; opacity: .9; z-index: 2; }
.mm-dl:hover { background: var(--accent); }
/* Moments 上传 */
.um-form .field { margin-bottom: 12px; }
.um-form textarea { width: 100%; min-height: 76px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; font-size: 14px; font-family: inherit; background: #fff; box-sizing: border-box; }
.um-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.um-th { width: 76px; height: 76px; overflow: hidden; border-radius: 4px; border: 1px solid var(--line); }
.um-th img { width: 100%; height: 100%; object-fit: cover; }
.photo-card img { width: 100%; height: 220px; object-fit: cover; display: block; transition: transform .2s; }
.photo-card:hover img { transform: scale(1.03); }
.photo-card .cap { padding: 10px 12px; font-size: 13px; color: var(--muted); }

/* 项目 */
.project-card { border-top: 3px solid var(--accent); }
.project-card h3 { font-size: 18px; font-family: var(--serif); font-weight: 700; }
.project-card h3 a { color: var(--accent-dark); text-decoration: none; }
.project-card h3 a:hover { color: var(--accent); }
.project-card p { color: var(--muted); font-size: 14px; margin-top: 8px; }

/* 数据 */
.chart-box { height: 340px; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* 后台 */
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.admin-head h2 { font-family: var(--serif); font-weight: 800; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
@media (max-width: 800px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat-box b { font-size: 26px; color: var(--accent); display: block; font-family: var(--serif); }
.stat-box span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.btn { display: inline-block; background: var(--accent); color: #fff; border: none; border-radius: 3px; padding: 9px 18px; font-size: 14px; cursor: pointer; text-decoration: none; transition: background .15s; }
.btn:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-danger { background: #B14A33; }
.btn-danger:hover { background: #8F3A28; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-xs { padding: 2px 8px; font-size: 12px; border-radius: 3px; }
.fl-mrow-tools { display: flex; gap: 6px; margin-left: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; font-family: var(--serif); }
.tbl th, .tbl td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl th { color: var(--muted); font-size: 11px; font-weight: 600; text-align: right; }
.tbl td:first-child, .tbl th:first-child { text-align: left; color: var(--ink); width: 42%; }
.tbl th:nth-child(2) { width: 58%; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .tot td { border-top: 1px solid var(--line); border-bottom: none; font-weight: 700; color: var(--accent); background: #FFFDF9; }

form .field { margin-bottom: 16px; }
form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
form input[type=text], form input[type=password], form input[type=date], form textarea, form input[type=number] { width: 100%; border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fff; }
form textarea { min-height: 300px; resize: vertical; }
form input:focus, form textarea:focus { outline: none; border-color: var(--accent); }

.flash { padding: 12px 16px; border-radius: 3px; margin-bottom: 18px; font-size: 14px; }
.flash-ok { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #F5C6B8; }
.flash-error { background: #FDE8E8; color: #991B1B; border: 1px solid #F5C2C2; }

.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.list-item .li-meta { color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 8px; }

.footer { background: #fff; border-top: 1px solid var(--line); padding: 24px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* 登录页：FT 品牌感 */
.login-card { text-align: center; padding: 40px 32px; }
.login-brand { font-family: var(--serif); font-size: 36px; font-weight: 700; letter-spacing: 3px; color: var(--ink); margin-bottom: 8px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-card form { text-align: left; }

/* ===== 运动与饮食日志（FT 风格） ===== */
.fl-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.fl-title { font-family: var(--serif); font-size: 26px; font-weight: 700; margin: 0; }
.fl-title small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 10px; letter-spacing: 0; }
.fl-daynav { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; }
.fl-daynav button { background: none; border: none; color: var(--muted); width: 34px; height: 34px; border-radius: 4px; cursor: pointer; font-size: 18px; }
.fl-daynav button:hover { background: var(--pink-bg); color: var(--accent); }
/* 人物选择 */
.fl-persons { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 4px; }
.fl-person { background: none; border: none; color: var(--muted); font-family: var(--serif); font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 3px; cursor: pointer; transition: all .15s; white-space: nowrap; }
.fl-person:hover { background: var(--pink-bg); color: var(--accent); }
.fl-person.active { background: var(--accent); color: #fff; }
.fl-cur { min-width: 112px; text-align: center; font-weight: 700; font-size: 14px; }
.fl-cur small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.fl-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 12px; }
@media (min-width: 760px) { .fl-stats { grid-template-columns: repeat(4, 1fr); } }
.fl-stat { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 4px; padding: 14px 16px; }
.fl-stat .fl-lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.fl-stat .fl-num { font-size: 28px; font-weight: 700; font-family: var(--serif); color: var(--accent); }
.fl-stat .fl-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.fl-sub.ok { color: #2F7D5B; }
.fl-sub.low { color: #C26A2B; }
.fl-sub.high { color: #B14A33; }
.fl-prog { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; margin-bottom: 12px; }
.fl-prog .head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.fl-prog .head b { color: #2F7D5B; font-size: 14px; letter-spacing: 0; }
/* 当天体重 + BMR */
.fl-wrow { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.fl-wbox { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 4px; padding: 14px 16px; flex: 1; min-width: 150px; }
.fl-wbox .fl-lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.fl-win { display: flex; align-items: center; gap: 6px; }
.fl-win input { width: 120px; border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; font-size: 16px; font-family: inherit; background: #fff; outline: none; }
.fl-win input:focus { border-color: var(--accent); }
.fl-win span { color: var(--muted); font-size: 12px; }
.fl-bmr { font-size: 24px; font-weight: 700; font-family: var(--serif); color: var(--accent); margin-top: 2px; }
.fl-bar { height: 9px; border-radius: 6px; background: #F3E9DC; overflow: hidden; }
.fl-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #C26A2B, var(--accent)); transition: width .5s; }
.fl-charts { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
@media (min-width: 760px) { .fl-charts { grid-template-columns: 1fr 1fr; } }
.fl-chart { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 14px 14px 8px; }
.fl-chart h3 { font-size: 14px; font-weight: 700; font-family: var(--serif); margin-bottom: 6px; padding: 0 4px; }
.fl-box { height: 250px; width: 100%; }
.fl-sect { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 16px; margin-bottom: 12px; }
.fl-sect .st { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fl-sect .st h2 { font-size: 16px; font-weight: 700; font-family: var(--serif); }
.fl-tag { font-size: 12px; color: var(--muted); }
.fl-ml { display: flex; flex-direction: column; gap: 8px; }
.fl-mrow { display: flex; align-items: center; gap: 10px; background: #FFFDF9; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; flex-wrap: wrap; }
.fl-mrow .nm { font-weight: 600; font-size: 14px; flex: 1; min-width: 140px; font-family: var(--serif); }
.fl-mrow .kcal { color: var(--accent); font-weight: 700; font-family: var(--serif); font-size: 16px; }
.fl-chip { font-size: 11px; padding: 2px 8px; border-radius: 3px; background: var(--pink-bg); color: var(--muted); border: 1px solid var(--line); font-family: var(--serif); }
.fl-chip.p { color: #2F7D5B; } .fl-chip.c { color: #3A6EA8; } .fl-chip.f { color: #C26A2B; }
.fl-meal { font-size: 11px; color: #fff; border-radius: 3px; padding: 2px 8px; font-weight: 600; }
.fl-meal.breakfast { background: #D05C40; } .fl-meal.lunch { background: #C9802E; }
.fl-meal.dinner { background: #B14A33; } .fl-meal.snack { background: #7A7F8A; }
.fl-exrow { display: flex; align-items: center; gap: 10px; background: #FFFDF9; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; margin-bottom: 8px; flex-wrap: wrap; }
.fl-exrow .nm { font-weight: 600; font-size: 14px; flex: 1; min-width: 140px; font-family: var(--serif); }
.fl-exrow .detail { font-size: 11px; color: var(--muted); background: var(--pink-bg); border: 1px solid var(--line); padding: 2px 8px; border-radius: 3px; font-family: var(--serif); }
.fl-exrow .sub { font-size: 11px; color: var(--muted); font-family: var(--serif); }
.fl-exrow .kcal { color: var(--accent); font-weight: 700; font-family: var(--serif); }
.fl-exsum { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 12px; flex-wrap: wrap; font-family: var(--serif); align-items: center; }
.fl-exsum b { color: var(--ink); font-size: 14px; }
.fl-exsum .fl-exsep { color: var(--line); font-weight: 700; }
.fl-exsum input { width: 64px; background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 4px 6px; color: var(--ink); outline: none; font-family: inherit; font-size: 13px; text-align: center; }
.fl-exsum input:focus { border-color: var(--accent); }
.fl-dets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fl-unit { font-style: normal; font-size: 11px; color: var(--muted); background: var(--pink-bg); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; margin-left: 6px; }
.fl-form { display: none; background: #FFFDF9; border: 1px solid var(--accent); border-radius: 4px; padding: 14px; margin-top: 10px; }
.fl-form.open { display: block; }
.fl-form h3 { font-size: 14px; font-weight: 700; font-family: var(--serif); margin-bottom: 10px; }
.fl-fg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.fl-fld { display: flex; flex-direction: column; gap: 4px; }
.fl-fld.full { grid-column: 1 / -1; }
.fl-fld label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.fl-fld input, .fl-fld select { background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 8px 9px; color: var(--ink); width: 100%; outline: none; font-family: inherit; font-size: 14px; }
.fl-fld input:focus, .fl-fld select:focus { border-color: var(--accent); }
.fl-btns { display: flex; gap: 8px; margin-top: 12px; }
.fl-rngrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.fl-cta { flex: none; }
.fl-sumgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
@media (min-width: 760px) { .fl-sumgrid { grid-template-columns: repeat(4, 1fr); } }
.fl-sum { background: #FFFDF9; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; }
.fl-sum .sl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.fl-sum .sv { font-size: 19px; font-weight: 700; font-family: var(--serif); margin-top: 2px; color: var(--accent); }
.fl-sum .sv.p { color: #2F7D5B; } .fl-sum .sv.c { color: #3A6EA8; } .fl-sum .sv.f { color: #C26A2B; }
.fl-sum small { font-size: 11px; color: var(--muted); font-weight: 400; font-family: var(--serif); }
.fl-asum { margin-top: 14px; }
.fl-asum h3 { font-size: 14px; font-weight: 700; font-family: var(--serif); margin-bottom: 8px; }
.fl-note { font-size: 11px; color: var(--muted); margin-top: 6px; }
.fl-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 0; font-family: var(--serif); }

/* ============================================
   响应式：平板（≤900px）与手机竖屏（≤640px）
   ============================================ */
@media (max-width: 900px) {
  .topbar-inner { height: auto; padding: 10px 0; }
  .hero h1 { font-size: 36px; }
  .article-full h1 { font-size: 28px; }
  .fl-title { font-size: 22px; }
  .fl-box { height: 260px; }
  .chart-box { height: 280px; }
}

@media (max-width: 640px) {
  .container { padding: 0 14px; }
  main.container { padding: 26px 14px 56px; }

  /* 顶栏：品牌+管理钮一行，导航换行独占一行 */
  .topbar-inner { flex-wrap: wrap; row-gap: 6px; padding: 12px 8px 8px; }
  .brand { font-size: 19px; letter-spacing: 1.2px; }
  .nav { order: 2; flex: 1 1 100%; gap: 12px; }
  .nav-link { font-size: 11px; letter-spacing: .5px; padding: 5px 7px; }
  .admin-link { font-size: 10px; padding: 4px 10px; letter-spacing: .4px; }

  /* Hero 大标题 */
  .hero { padding: 30px 2px 16px; }
  .hero h1 { font-size: 28px; letter-spacing: 1px; }
  .hero p { font-size: 14px; margin-top: 8px; }
  .hero-stats { gap: 26px; margin-top: 22px; }
  .hero-stat b { font-size: 21px; }

  /* 区块与卡片 */
  .section-title { margin: 30px 0 14px; font-size: 13px; }
  .card { padding: 18px 16px; }
  .article-card h3 { font-size: 17px; }
  .article-cover { height: 140px; }
  .ac-cover { height: 130px; }
  .ac-cover img { height: 130px; }
  .article-full h1 { font-size: 23px; }
  .article-full img.article-cover { height: auto !important; max-height: 230px; }
  .article-body { font-size: 15px; }
  .photo-card img { height: 180px; }

  /* 登录页 */
  .login-card { padding: 28px 16px; }
  .login-brand { font-size: 27px; letter-spacing: 2px; }
  .login-wrap { margin: 26px auto !important; }

  /* 表格：宽表横向滚动，窄表保持两列 */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 520px; }
  .tbl { table-layout: auto; }
  .tbl th, .tbl td { white-space: normal; overflow: visible; }

  /* 日志页 */
  .fl-title { font-size: 20px; }
  .fl-title small { display: block; margin-left: 0; margin-top: 2px; }
  .fl-daynav button { width: 32px; height: 32px; }
  .fl-person { padding: 8px 14px; font-size: 12px; }
  .fl-stats { gap: 10px; }
  .fl-stat { padding: 12px 12px; }
  .fl-num { font-size: 24px; }
  .fl-stat .fl-sub { font-size: 10px; }
  .fl-box { height: 220px; }
  .fl-fg { grid-template-columns: 1fr; }
  .fl-fld.full { grid-column: auto; }
  .fl-dets { grid-template-columns: repeat(4, 1fr); }
  .fl-mrow .nm, .fl-exrow .nm { min-width: 0; flex: 1 1 100%; }
  .fl-mrow .kcal { font-size: 15px; }
  .fl-rngrow .fl-cta { width: 100%; }
  .fl-rngrow .fl-cta .btn { width: 100%; }
  .fl-sumgrid { gap: 8px; }
  .fl-sum { padding: 9px 10px; }
  .fl-sum .sv { font-size: 17px; }
  .fl-exsum { gap: 12px; }

  /* 后台 */
  .admin-head { align-items: flex-start; }
  .stat-row { gap: 10px; }
  .stat-box { padding: 12px 14px; }
  .stat-box b { font-size: 22px; }
  .list-item { flex-wrap: wrap; }
  .list-item .actions { width: 100%; justify-content: flex-end; }

  /* 按钮与输入：触控友好 */
  .btn { padding: 10px 16px; }
  .btn-sm { padding: 8px 14px; }
  .btn-xs { padding: 6px 10px; }
  form input[type=text], form input[type=password], form input[type=date], form textarea, form input[type=number] { padding: 12px; font-size: 16px; }
  .fl-fld input, .fl-fld select { padding: 11px; font-size: 16px; }
  .fl-btns .btn { flex: 1; }

  .footer { padding: 20px 0; }
}


/* ===== 文章正文：IREN 报告（FT 风格） ===== */
.irena { font-family: var(--serif); color: var(--ink); font-size: 14.5px; line-height: 1.72; }
.irena header.top { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 22px; }
.irena .kicker { font-size: 11.5px; letter-spacing: .12em; color: var(--accent); text-transform: uppercase; margin-bottom: 8px; font-weight: 700; }
.irena .sub { font-size: 14px; color: var(--muted); max-width: 820px; }
.irena .stamp { margin-top: 10px; font-size: 12px; color: var(--muted); }
.irena .stamp b { color: var(--ink); font-weight: 600; }
.irena h2 { font-size: 18px; font-weight: 700; margin: 34px 0 6px; display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.irena h2 .num { font-size: 12px; color: var(--accent); font-weight: 700; flex: none; }
.irena h3 { font-size: 15px; font-weight: 700; margin: 20px 0 10px; color: var(--ink); }
.irena p.lead { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; max-width: 880px; }
.irena section { scroll-margin-top: 20px; }
.irena .card { background: #FFFDF9; border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; margin: 12px 0; }
.irena .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 18px 0 8px; }
.irena .kpi { background: #FFFDF9; border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.irena .kpi .lab { font-size: 11px; color: var(--muted); margin-bottom: 5px; letter-spacing: .03em; }
.irena .kpi .val { font-size: 21px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; color: var(--ink); }
.irena .kpi .note { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.irena table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.irena th { text-align: left; padding: 8px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--ink); vertical-align: bottom; font-size: 11.5px; letter-spacing: .05em; }
.irena td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.irena tr:last-child td { border-bottom: none; }
.irena td b { font-weight: 700; }
.irena .muted { color: var(--muted); font-size: 12px; display: block; margin-top: 3px; line-height: 1.5; }
.irena .num-r { text-align: right; }
.irena .pill { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 20px; white-space: nowrap; font-weight: 700; }
.irena .p-teal { background: #E5F2EC; color: #2F7D5B; border: 1px solid #BFDCCF; }
.irena .p-blue { background: #E7F0F8; color: #3A6EA8; border: 1px solid #C4D8EC; }
.irena .p-amber { background: #F8EDDD; color: #C26A2B; border: 1px solid #EBD9BE; }
.irena .p-red { background: #F9E8E4; color: #B14A33; border: 1px solid #EBCAC1; }
.irena .p-purple { background: #EEECF8; color: #5A4FA8; border: 1px solid #D4D0EA; }
.irena .p-green { background: #E9F3E4; color: #3B7A2E; border: 1px solid #C8E0BE; }
.irena .p-gray { background: #F3F0EA; color: #6B6B6B; border: 1px solid #E0DBD2; }
.irena ul.pts { list-style: none; margin: 10px 0; }
.irena ul.pts li { position: relative; padding-left: 24px; margin-bottom: 11px; font-size: 13.5px; color: var(--muted); line-height: 1.68; }
.irena ul.pts li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.irena ul.pts li b { color: var(--ink); font-weight: 700; }
.irena ul.pts li b.k { color: #2F7D5B; }
.irena ul.pts li b.r { color: #B14A33; }
.irena ul.pts li b.a { color: #C26A2B; }
.irena ul.pts li b.b { color: #3A6EA8; }
.irena ul.pts li b.p { color: #5A4FA8; }
.irena .bars { margin: 14px 0 6px; }
.irena .barrow { display: grid; grid-template-columns: 92px 1fr 120px; gap: 12px; align-items: center; margin-bottom: 9px; }
.irena .barlab { font-size: 12.5px; color: var(--muted); text-align: right; }
.irena .track { background: #F3F0EA; border-radius: 4px; height: 18px; position: relative; overflow: hidden; }
.irena .fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; font-size: 11.5px; color: #fff; font-weight: 700; }
.irena .barval { font-size: 12.5px; color: var(--muted); }
.irena .barval b { color: var(--ink); font-weight: 700; }
.irena .timeline { position: relative; padding-left: 26px; margin: 14px 0; }
.irena .timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.irena .tl { position: relative; margin-bottom: 16px; }
.irena .tl::before { content: ""; position: absolute; left: -23px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid #FFFDF9; }
.irena .tl .d { font-size: 12px; color: var(--muted); font-weight: 700; }
.irena .tl .t { font-size: 13.5px; color: var(--ink); font-weight: 700; margin: 1px 0 3px; }
.irena .tl .b { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.irena .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.irena .callout { border-left: 3px solid #C26A2B; background: #FBF3E6; border-radius: 0 6px 6px 0; padding: 12px 15px; margin: 12px 0; font-size: 13px; color: var(--muted); }
.irena .callout b { color: var(--ink); }
.irena .callout.red { border-left-color: #B14A33; background: #FAECE8; }
.irena .callout.blue { border-left-color: #3A6EA8; background: #ECF2F8; }
.irena .callout.teal { border-left-color: #2F7D5B; background: #EAF2EE; }
.irena .quote { font-size: 12.5px; color: var(--muted); font-style: italic; border-left: 2px solid var(--line); padding: 2px 0 2px 14px; margin: 10px 0; line-height: 1.62; }
.irena .src { font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.irena footer { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.7; }
.irena .toc { background: #FFFDF9; border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; margin-bottom: 20px; }
.irena .toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 26px; font-size: 12.5px; color: var(--muted); }
.irena .toc li { margin-bottom: 4px; }
.irena .toc a { color: var(--muted); text-decoration: none; }
.irena .toc a:hover { color: var(--accent); }
.irena .hl { background: linear-gradient(transparent 62%, #F0D9D0 62%); font-weight: 700; color: var(--ink); }
@media (max-width: 820px) {
  .irena .two { grid-template-columns: 1fr; }
  .irena .barrow { grid-template-columns: 74px 1fr 92px; }
  .irena .toc ol { columns: 1; }
  .irena table { font-size: 12px; }
}
