/* heymedia-ops 样式 —— 政务风格配色（墨绿 · 米白 · 金） */
:root {
  --brand-deep: #1E4A3A;
  --brand-deeper: #16382C;
  --brand: #2A6B52;
  --brand-light: #3E7F63;
  --gold: #C6A664;
  --gold-light: #E0CB9C;
  --bg: #F4F1E9;
  --card: #FFFFFF;
  --text: #1F2A25;
  --muted: #6B7A72;
  --border: #E1DBCB;
  --border-soft: #EFEBE0;
  --income: #A93A33;
  --expense: #2A6B52;
  --amber: #9A6B22;
  --radius: 8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 15px; }
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.error { color: var(--income); font-size: .82rem; margin-top: .55rem; min-height: 1.1em; }
.ok { color: var(--expense); font-size: .82rem; text-align: center; margin: .5rem 0; }

/* ================= 登录页 ================= */
.login-wrap { min-height: 100vh; display: flex; background: #FBF9F3; }
.login-brand {
  width: 58%; min-height: 100vh; position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.026) 0 1px, transparent 1px 7px),
    linear-gradient(160deg, #24513F 0%, #1E4A3A 45%, #183A2D 100%);
  color: #F4EFE2; padding: 34px 44px 40px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-brand::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 34%;
  background: linear-gradient(to top, rgba(12,30,24,.55), transparent); pointer-events: none;
}
.brand-mark { display: flex; align-items: center; gap: .55rem; font-size: .82rem; letter-spacing: .18em; color: #E9E1CB; position: relative; z-index: 1; }
.brand-mark .sq { width: 13px; height: 13px; background: var(--gold); border-radius: 2px; display: inline-block; }
.brand-quote { position: relative; z-index: 1; max-width: 520px; }
.brand-quote .day { font-size: .74rem; letter-spacing: .22em; color: #B9AD8C; margin-bottom: 1.1rem; }
.brand-quote h2 {
  font-family: "Songti SC", "Songti", "Noto Serif SC", Georgia, serif;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 400; line-height: 1.65; letter-spacing: .04em; color: #FBF7EA;
}
.brand-quote p { margin-top: 1.1rem; font-size: .84rem; line-height: 1.95; color: #C3C9BC; }
.brand-foot { position: relative; z-index: 1; font-size: .72rem; letter-spacing: .06em; color: #9FAE9C; }

.login-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2.5rem 2rem; }
.login-box { width: 100%; max-width: 330px; }
.login-box h1 { font-size: 1.5rem; font-weight: 500; letter-spacing: .04em; color: #1C2A24; }
.login-hint { font-size: .78rem; color: var(--muted); margin: .5rem 0 2.1rem; }
.field { display: block; margin-bottom: 1.15rem; }
.field span { display: block; font-size: .76rem; color: #5D6B64; margin-bottom: .42rem; letter-spacing: .05em; }
.field input {
  width: 100%; padding: .72rem .8rem; font-size: .95rem; color: var(--text);
  border: 1px solid #D9D3C2; border-radius: 3px; background: #FFFFFF; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(42,107,82,.1); }
.login-box .btn.primary { margin-top: .5rem; border-radius: 3px; padding: .78rem; letter-spacing: .3em; font-size: .9rem; }
.login-note { font-size: .7rem; color: #8A968E; line-height: 1.9; margin-top: 2.2rem; padding-top: 1rem; border-top: 1px solid var(--border-soft); }

/* ================= 主框架 ================= */
#app-view { min-height: 100vh; display: flex; }

.sidebar {
  width: 216px; flex: 0 0 216px; background: linear-gradient(180deg, #23503F, #1B4234 60%, #173A2D);
  color: #E8E4D5; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
}
.side-brand { display: flex; align-items: center; gap: .5rem; padding: 1.5rem 1.25rem 1.35rem; font-size: .84rem; letter-spacing: .16em; color: #F1EBD8; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand .sq { width: 11px; height: 11px; background: var(--gold); border-radius: 2px; }
.side-nav { flex: 1; padding: .9rem .6rem; display: flex; flex-direction: column; gap: .18rem; }
.nav-item {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; background: none; border: none;
  color: #C9D3C9; font-size: .88rem; padding: .68rem .8rem; border-radius: 4px; cursor: pointer;
  border-left: 2px solid transparent; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #F3EFE1; }
.nav-item.active { background: rgba(198,166,100,.14); border-left-color: var(--gold); color: #FBF6E7; font-weight: 500; }
.nav-item .num { font-size: .66rem; color: #8E9E92; letter-spacing: .05em; }
.nav-item.active .num { color: var(--gold); }
.side-foot { padding: .9rem 1.1rem 1.3rem; font-size: .74rem; color: #9DAA9F; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: center; }
.side-foot a { color: #CBB98A; text-decoration: none; }

.content-wrap { flex: 1; margin-left: 216px; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: #FFFDF7; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; padding: .95rem 1.6rem;
  font-size: .95rem; font-weight: 500; color: #1E2E27; letter-spacing: .05em;
}
.topbar .user-info { font-size: .78rem; font-weight: 400; color: var(--muted); display: none; }
.topbar .user-info a { color: var(--brand); }
main { padding: 1.2rem 1.6rem 2rem; max-width: 1000px; width: 100%; margin: 0 auto; }
.tabbar { display: none; }

/* ================= 组件 ================= */
.card { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1.15rem 1.2rem; margin-bottom: .9rem; }
.card h3 { font-size: .92rem; font-weight: 500; color: #22322A; margin-bottom: .85rem; padding-left: .6rem; border-left: 2px solid var(--gold); line-height: 1.2; }
.btn { border: 1px solid transparent; border-radius: 3px; padding: .58rem 1rem; font-size: .87rem; cursor: pointer; font-family: inherit; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn.block { width: 100%; margin-top: .7rem; }
.btn.ghost { background: #F6F3EA; color: var(--brand); border-color: var(--border); }
.btn.sm { padding: .4rem .75rem; font-size: .78rem; }
.btn.mini { background: #EDF3EE; color: var(--brand); border-color: #D2E0D6; padding: .28rem .65rem; font-size: .74rem; }
.btn.danger { background: #FAEDEA; color: var(--income); border-color: #EED5D0; padding: .28rem .65rem; font-size: .74rem; }

.seg { display: flex; gap: .4rem; margin-bottom: .9rem; }
.seg.wrap { flex-wrap: wrap; }
.seg-btn { flex: 1; border: 1px solid var(--border); background: #FFFDF8; border-radius: 3px; padding: .48rem .3rem; font-size: .82rem; color: #5C6B63; cursor: pointer; font-family: inherit; }
.seg.wrap .seg-btn { flex: 0 0 auto; padding: .45rem .85rem; }
.seg-btn.active { background: var(--brand); border-color: var(--brand); color: #FCF9EF; }

.form label { display: block; font-size: .78rem; color: #5C6B63; margin-bottom: .85rem; letter-spacing: .03em; }
.form input, .form select {
  width: 100%; margin-top: .35rem; padding: .62rem .7rem; border: 1px solid #D9D3C2; border-radius: 3px;
  font-size: .92rem; background: #fff; color: var(--text); font-family: inherit;
}
.form input:focus, .form select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(42,107,82,.1); }
.form .row-check { display: flex; align-items: center; gap: .5rem; }
.form .row-check input { width: auto; margin: 0; }

.shares-box { border: 1px solid var(--border); border-radius: 4px; padding: .8rem; margin-bottom: .9rem; background: #FCFAF4; }
.shares-box legend { font-size: .76rem; color: #5C6B63; padding: 0 .35rem; }
.share-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem; font-size: .82rem; }
.share-row select { flex: 1.4; padding: .42rem; border: 1px solid #D9D3C2; border-radius: 3px; font-family: inherit; }
.share-row input { width: 68px; padding: .42rem; border: 1px solid #D9D3C2; border-radius: 3px; }
.share-amt { min-width: 76px; text-align: right; font-weight: 500; color: var(--brand); }
.share-row .del { color: var(--income); border: none; background: none; font-size: 1rem; cursor: pointer; }

/* 订单 / 项目卡片 */
.order-card, .proj-card { background: #FFFDF8; border: 1px solid var(--border-soft); border-radius: var(--radius); padding: .95rem 1.1rem; margin-bottom: .75rem; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.order-head b { font-size: .92rem; font-weight: 500; }
.badge { font-size: .68rem; padding: .16rem .55rem; border-radius: 2px; letter-spacing: .04em; border: 1px solid transparent; }
.badge.doing { background: #EDF2F7; color: #2B5675; border-color: #D8E4EE; }
.badge.wait { background: #FAF2E2; color: var(--amber); border-color: #EFE1C6; }
.badge.done { background: #EAF1EC; color: var(--brand); border-color: #D5E4DA; }
.order-meta, .proj-meta { font-size: .76rem; color: var(--muted); margin: .4rem 0 .55rem; line-height: 1.7; }
.share-line { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; padding: .42rem 0; border-top: 1px solid var(--border-soft); }
.proj-card .stage { font-size: .7rem; background: #F3EEE0; color: #6E5A2A; padding: .16rem .55rem; border-radius: 2px; border: 1px solid #E6DCC3; }
.proj-actions { display: flex; gap: .45rem; margin-top: .55rem; flex-wrap: wrap; }
.proj-actions select, .proj-actions button { font-size: .75rem; padding: .3rem .5rem; border-radius: 3px; border: 1px solid var(--border); background: #fff; font-family: inherit; color: #39473F; }
.overdue { color: var(--income); font-weight: 500; }

/* 看板 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; margin-bottom: .9rem; }
.stat { background: #FFFDF8; border: 1px solid var(--border-soft); border-left: 3px solid var(--gold); border-radius: 4px; padding: .85rem .95rem; }
.stat .k { font-size: .72rem; color: var(--muted); letter-spacing: .03em; }
.stat .v { font-size: 1.22rem; font-weight: 500; margin-top: .28rem; color: #1C2C24; letter-spacing: .01em; }
.stat .v.green, .stat .v.red { color: var(--income); }
.stat .v.amber { color: var(--amber); }
.record-line { display: flex; justify-content: space-between; font-size: .82rem; padding: .55rem 0; border-top: 1px solid var(--border-soft); align-items: center; gap: .6rem; }
.record-line .amt.in { color: var(--income); font-weight: 500; }
.record-line .amt.out { color: var(--expense); font-weight: 500; }
.record-line .sub { display: block; font-size: .72rem; color: var(--muted); margin-top: .1rem; }

/* 管理 */
.dict-add { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: .8rem; }
.dict-add input { flex: 1; min-width: 110px; padding: .5rem .6rem; border: 1px solid #D9D3C2; border-radius: 3px; font-size: .85rem; font-family: inherit; }
.dict-list { list-style: none; }
.dict-list li { display: flex; justify-content: space-between; align-items: center; padding: .55rem .1rem; border-top: 1px solid var(--border-soft); font-size: .85rem; }
.dict-list li.off span { color: #9AA69E; text-decoration: line-through; }
.dict-list .ops { display: flex; gap: .35rem; }
.dict-list .ops button { border: 1px solid var(--border); background: #FBFAF5; border-radius: 3px; padding: .22rem .55rem; font-size: .72rem; color: #4C5A52; font-family: inherit; cursor: pointer; }

#toast { position: fixed; left: 50%; bottom: 6rem; transform: translateX(-50%); background: rgba(30,74,58,.95); color: #F7F3E6; padding: .6rem 1.2rem; border-radius: 3px; font-size: .82rem; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99; }
#toast.show { opacity: 1; }

/* 备案号页脚 */
.site-beian { text-align: center; padding: 1.1rem 1rem 1.6rem; font-size: .72rem; letter-spacing: .04em; }
.site-beian a { color: #96A097; text-decoration: none; border-bottom: 1px solid #DCD6C6; padding-bottom: 1px; }
.site-beian a:hover { color: var(--green-600, #2A6B52); }
.login-beian { margin-top: 1.1rem; font-size: .7rem; text-align: left; }
.login-beian a { color: #96A097; text-decoration: none; }
.check-field { display: flex !important; align-items: flex-start; gap: .5rem; margin-top: -.2rem; }
.check-field input { margin-top: .18rem; }
.check-field span { margin-bottom: 0 !important; line-height: 1.5; }

/* ================= 移动端 ================= */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .content-wrap { margin-left: 0; }
  .topbar { padding: .85rem 1rem; font-size: .9rem; }
  .topbar .user-info { display: block; }
  main { padding: .85rem .85rem 5.6rem; }
  .site-beian { padding-bottom: calc(5.2rem + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #FFFDF8;
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); z-index: 40;
  }
  .tabbar .nav-item {
    flex: 1; flex-direction: column; gap: .18rem; justify-content: center; border-left: none; border-top: 2px solid transparent;
    padding: .5rem 0 .45rem; font-size: .74rem; color: var(--muted); background: none; border-radius: 0; text-align: center;
  }
  .tabbar .nav-item .num { display: none; }
  .tabbar .nav-item.active { background: none; border-top-color: var(--gold); color: var(--brand); font-weight: 500; }

  .login-wrap { flex-direction: column; }
  .login-brand { width: 100%; min-height: 232px; padding: 22px 24px 26px; }
  .brand-quote h2 { font-size: 1.28rem; line-height: 1.62; }
  .brand-quote p, .brand-foot { display: none; }
  .brand-quote .day { margin-bottom: .7rem; }
  .login-panel { padding: 1.8rem 1.5rem 2.4rem; align-items: flex-start; }
  .login-box { max-width: 100%; }
  .login-box h1 { font-size: 1.3rem; }
  .login-hint { margin-bottom: 1.5rem; }
  .login-note { margin-top: 1.6rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 901px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  main { padding: 1.4rem 2rem 2.4rem; }
}
