/* ==========================================================================
   浙江中材数字化平台 —— 门户样式
   品牌色：深蓝 #0D3B66  青蓝 #1B8BB5  墨蓝 #030B14  金 #D4A843
   ========================================================================== */
:root {
  --navy: #0D3B66;
  --navy-deep: #092B4D;
  --teal: #1B8BB5;
  --teal-light: #2BA3CC;
  --ink: #030B14;
  --gold: #D4A843;
  --bg: #F2F5F9;
  --card: #FFFFFF;
  --text: #1F2A37;
  --text-soft: #5A6B7C;
  --line: #E2E8F0;
  --ok: #1E9E6A;
  --warn: #D9822B;
  --err: #C4362F;
  --shadow: 0 1px 3px rgba(13, 59, 102, .08), 0 8px 24px rgba(13, 59, 102, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 顶部导航 ---------------- */
.topbar {
  background: linear-gradient(90deg, var(--ink) 0%, var(--navy-deep) 45%, var(--navy) 100%);
  color: #fff;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(3, 11, 20, .18);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .mark {
  display: block;
  height: auto; width: auto;
  max-height: 32px; max-width: 220px;
  flex: 0 0 auto;
  background: rgba(255,255,255,.94);
  border-radius: 7px; padding: 3px 8px;
  box-sizing: content-box;
}
.brand .name { font-size: 17px; font-weight: 600; letter-spacing: .5px; white-space: nowrap; }
.brand .sub { font-size: 12px; color: rgba(255,255,255,.55); white-space: nowrap; }

.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.userchip {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.13);
  padding: 5px 12px 5px 5px; border-radius: 999px;
}
.userchip .avatar {
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--gold); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.btn-ghost {
  color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.28);
  padding: 6px 14px; border-radius: 6px; font-size: 13px; background: transparent;
  cursor: pointer; transition: all .18s;
}
.btn-ghost:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }

/* ---------------- 横幅 ---------------- */
.hero {
  background: linear-gradient(120deg, var(--navy) 0%, var(--teal) 78%, var(--teal-light) 100%);
  color: #fff;
  padding: 34px 24px 40px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -90px; top: -90px;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.hero::before {
  content: ""; position: absolute; right: 60px; bottom: -140px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(212,168,67,.12);
}
.hero-inner { max-width: 1180px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { margin: 0 0 6px; font-size: 25px; font-weight: 600; letter-spacing: .5px; }
.hero p { margin: 0; color: rgba(255,255,255,.82); font-size: 13.5px; }
.hero .gold-rule { width: 46px; height: 3px; background: var(--gold); border-radius: 2px; margin: 14px 0 16px; }

/* ---------------- 主体 ---------------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 24px 50px; }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 0 16px;
}
.section-head h2 {
  font-size: 16px; margin: 0; font-weight: 600; color: var(--navy);
  display: flex; align-items: center; gap: 9px;
}
.section-head h2::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: var(--gold); display: inline-block;
}
.section-head .hint { font-size: 12.5px; color: var(--text-soft); }

/* ---------------- 应用卡片 ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 16px;
}
.appcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: flex; gap: 14px; align-items: flex-start;
  box-shadow: var(--shadow);
  transition: transform .16s, box-shadow .16s, border-color .16s;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.appcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(13,59,102,.14);
  border-color: rgba(27,139,181,.4);
  text-decoration: none;
}
.appcard::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent, var(--teal));
}
.appcard .ico {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; letter-spacing: .3px;
  background: var(--accent, var(--teal));
}
.appcard .meta { min-width: 0; }
.appcard .meta .t { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.appcard .meta .d { font-size: 12.5px; color: var(--text-soft); }
.appcard .tagline {
  margin-top: 8px; font-size: 11.5px; color: var(--teal);
  display: inline-flex; align-items: center; gap: 4px;
}
.appcard.disabled { opacity: .55; pointer-events: none; }

/* ---------------- 登录页 ---------------- */
.login-shell {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 20% -10%, #164a7d 0%, var(--ink) 62%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 412px;
  background: #fff; border-radius: 16px; padding: 38px 34px 32px;
  box-shadow: 0 24px 60px rgba(3,11,20,.45);
  text-align: center;
}
.login-card .logo {
  display: block;
  height: auto; width: auto;
  max-height: 58px; max-width: 82%;
  margin: 0 auto 16px;
}
.login-card h1 { font-size: 20px; margin: 0 0 6px; color: var(--navy); font-weight: 600; }
.login-card .org { font-size: 12.5px; color: var(--text-soft); margin-bottom: 24px; }
.login-card .gold-rule { width: 40px; height: 3px; background: var(--gold); border-radius: 2px; margin: 0 auto 24px; }
.btn-wecom {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 18px; border-radius: 9px;
  background: #2B7DE9; color: #fff; font-size: 15px; font-weight: 500;
  border: none; cursor: pointer; transition: background .18s;
}
.btn-wecom:hover { background: #1f6fd6; text-decoration: none; color: #fff; }
.login-card .tip { margin-top: 18px; font-size: 12px; color: var(--text-soft); line-height: 1.8; }
.login-card .tip code { background: #F1F5F9; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }

/* ---------------- 提示条 ---------------- */
.notice {
  border-radius: 10px; padding: 13px 16px; font-size: 13.5px;
  margin-bottom: 18px; border: 1px solid;
  display: flex; gap: 10px; align-items: flex-start;
}
.notice .lbl { font-weight: 600; white-space: nowrap; }
.notice.warn { background: #FFF8EC; border-color: #F0D9A8; color: #8A6216; }
.notice.ok { background: #EDFAF3; border-color: #B7E4CD; color: #176146; }
.notice.err { background: #FDF0EF; border-color: #F0C3C0; color: #8F2A25; }
.notice.info { background: #EEF6FC; border-color: #BFDCF0; color: #1A5578; }

/* ---------------- 表格 ---------------- */
table.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line); }
table.tbl th { background: #F7FAFC; color: var(--navy); font-weight: 600; font-size: 12.5px; letter-spacing: .3px; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl td.mono { font-family: Consolas, Monaco, monospace; font-size: 12.5px; color: var(--text-soft); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; }
.pill.ok { background: #E5F6EE; color: var(--ok); }
.pill.warn { background: #FDF3E3; color: var(--warn); }
.pill.err { background: #FBEAE9; color: var(--err); }
.pill.info { background: #EAF3FA; color: var(--teal); }

/* ---------------- 页脚 ---------------- */
.footer {
  background: var(--ink); color: rgba(255,255,255,.5);
  padding: 22px 24px; font-size: 12.5px; text-align: center;
}
.footer .gold { color: var(--gold); }

/* ==========================================================================
   食堂订餐模块
   ========================================================================== */

/* ---------------- 通用控件 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; box-shadow: var(--shadow);
}
.btn-primary {
  display: inline-block; width: 100%; padding: 14px 20px; margin-top: 6px;
  border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(120deg, var(--navy) 0%, var(--teal) 100%);
  color: #fff; font-size: 16px; font-weight: 600; letter-spacing: 1px;
  transition: filter .16s, transform .16s;
}
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; }
.btn-primary:active { transform: translateY(1px); }
.btn-alt {
  display: inline-block; width: 100%; padding: 12px 18px; text-align: center;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  color: var(--navy); font-size: 14.5px; cursor: pointer;
}
.btn-alt:hover { background: #F7FAFC; text-decoration: none; }
.mini-btn {
  padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--navy); font-size: 12px; cursor: pointer;
}
.mini-btn:hover { background: #F1F5F9; }
.mini-btn.danger { color: var(--err); border-color: #F0C3C0; }
.mini-btn.danger:hover { background: #FBEAE9; }

.inp {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 14.5px; background: #fff; color: var(--text);
  font-family: inherit;
}
.inp:focus { outline: 2px solid rgba(27,139,181,.35); border-color: var(--teal); }
.inp.mono { font-family: Consolas, Monaco, monospace; font-size: 13px; }

.kvrow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kvrow:last-of-type { border-bottom: none; }
.kvrow .k { color: var(--text-soft); }
.kvrow .v { font-weight: 600; color: var(--navy); text-align: right; }

.field { margin: 18px 0; }
.flabel { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 10px; }
.fhelp { font-size: 12px; color: var(--text-soft); margin-top: 8px; }

.pnum-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pnum { position: relative; }
.pnum input { position: absolute; opacity: 0; pointer-events: none; }
.pnum span {
  display: flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 12px;
  border: 2px solid var(--line); background: #fff;
  font-size: 20px; font-weight: 600; color: var(--text-soft);
  cursor: pointer; transition: all .15s;
}
.pnum input:checked + span {
  border-color: var(--teal); background: rgba(27,139,181,.08); color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,139,181,.12);
}

.row-links { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 18px; font-size: 13.5px; }

.login-or { position: relative; text-align: center; margin: 16px 0; }
.login-or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.login-or span { position: relative; background: #fff; padding: 0 12px; font-size: 12px; color: var(--text-soft); }
.login-form { text-align: left; margin-top: 14px; }
.login-form label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 12px; }
.login-form input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 9px; font-size: 15px;
}
.login-form input:focus { outline: 2px solid rgba(27,139,181,.35); border-color: var(--teal); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 20px; }
.filter-bar label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-soft); }
.filter-bar input[type="date"], .filter-bar select {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff;
}
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: end; }
.grid-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-soft); }

/* ---------------- 统计条 ---------------- */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-box {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; text-align: center; box-shadow: var(--shadow);
}
.stat-box .sn { font-size: 32px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat-box.accent .sn { color: var(--teal); }
.stat-box .sl { font-size: 13px; color: var(--text-soft); margin-top: 6px; }

.dept-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.chip {
  background: #EEF6FC; border: 1px solid #BFDCF0; color: #1A5578;
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px;
}
.chip b { color: var(--navy); }

/* ---------------- 订餐成功凭证 ---------------- */
.canteen-ticket-body { background: radial-gradient(1000px 520px at 50% -10%, #164a7d 0%, var(--ink) 60%); }
.ticket-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px; }
.ticket {
  width: 100%; max-width: 420px; background: #fff; border-radius: 20px;
  padding: 34px 30px 26px; text-align: center;
  box-shadow: 0 26px 70px rgba(3,11,20,.5);
  position: relative; overflow: hidden;
}
.ticket::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
}
.ticket-ok {
  width: 76px; height: 76px; margin: 4px auto 14px; border-radius: 50%;
  background: linear-gradient(135deg, #1E9E6A, #35b881); color: #fff;
  font-size: 42px; line-height: 76px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(30,158,106,.35);
}
.ticket-title { font-size: 26px; font-weight: 700; color: var(--navy); letter-spacing: 2px; }
.ticket-sub { font-size: 13.5px; color: var(--text-soft); margin-top: 6px; }
.ticket-portions { margin: 22px 0; display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.ticket-portions .num { font-size: 72px; font-weight: 800; color: var(--teal); line-height: 1; }
.ticket-portions .unit { font-size: 24px; font-weight: 600; color: var(--navy); }
.ticket-info { border-top: 1px dashed var(--line); padding-top: 16px; }
.ticket-info > div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.ticket-info span { color: var(--text-soft); }
.ticket-info b { color: var(--navy); }
.ticket-note { margin-top: 12px; font-size: 13px; color: var(--warn); }
.ticket-foot { margin-top: 18px; font-size: 12.5px; color: var(--text-soft); border-top: 1px dashed var(--line); padding-top: 14px; }
.ticket-actions { display: flex; gap: 14px; margin-top: 22px; width: 100%; max-width: 420px; }
.ticket-actions .btn-alt { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); }
.ticket-actions .btn-alt:hover { background: rgba(255,255,255,.2); }

/* ---------------- 二维码海报 ---------------- */
.qr-poster {
  background: #fff; border: 2px solid var(--navy); border-radius: 18px;
  padding: 30px; text-align: center; box-shadow: var(--shadow);
}
.qr-poster-head { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 22px; }
.qr-poster-head img { height: 46px; width: auto; }
.qr-poster-head .qp-title { font-size: 22px; font-weight: 700; color: var(--navy); letter-spacing: 1px; }
.qr-poster-head .qp-sub { font-size: 13px; color: var(--text-soft); margin-top: 4px; }
.qr-box { display: inline-block; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.qr-box img { display: block; width: 100%; max-width: 440px; height: auto; }
.qp-url { margin-top: 14px; font-size: 13px; color: var(--text-soft); word-break: break-all; }
.qp-steps { margin-top: 22px; text-align: left; display: inline-block; }
.qp-step { font-size: 14px; color: var(--text); padding: 7px 0; }
.qp-step b { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--teal); color: #fff; font-size: 12px; margin-right: 8px; }
.qp-foot { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--text-soft); }

/* ---------------- 大屏展示 ---------------- */
.canteen-screen-body { background: #030B14; overflow: hidden; }
.screen {
  min-height: 100vh; padding: 3vh 3vw; color: #EAF2F8;
  background: radial-gradient(1400px 800px at 12% -12%, #123a63 0%, #030B14 62%);
  display: flex; flex-direction: column;
}
.screen-head { display: flex; align-items: center; justify-content: space-between; }
.screen-brand { display: flex; align-items: center; gap: 16px; }
.screen-brand img { height: 46px; width: auto; background: rgba(255,255,255,.94); border-radius: 8px; padding: 4px 10px; }
.sb-name { font-size: clamp(18px, 1.9vw, 28px); font-weight: 600; letter-spacing: 1px; }
.sb-sub { font-size: clamp(12px, 1.1vw, 17px); color: rgba(234,242,248,.6); margin-top: 3px; }
.screen-clock { font-family: Consolas, Monaco, monospace; font-size: clamp(26px, 3.2vw, 52px); font-weight: 700; color: var(--gold); letter-spacing: 2px; }
.screen-date { margin-top: 2vh; font-size: clamp(15px, 1.5vw, 24px); color: rgba(234,242,248,.75); letter-spacing: 1px; }
.screen-main { display: grid; grid-template-columns: 1.35fr 1.35fr 1fr; gap: 2vw; margin: 3vh 0; }
.scard {
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px; padding: 3.4vh 2vw; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.scard.big .sv { font-size: clamp(56px, 9vw, 150px); }
.scard .sv { font-size: clamp(40px, 6vw, 96px); font-weight: 800; line-height: 1; color: #fff; }
.scard.big.accent .sv { color: var(--gold); }
.scard .sl { margin-top: 2vh; font-size: clamp(14px, 1.5vw, 26px); color: rgba(234,242,248,.72); letter-spacing: 3px; }
.screen-depts { flex: 1; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: 20px; padding: 2.4vh 2.4vw; min-height: 0; }
.sd-title { font-size: clamp(14px, 1.4vw, 22px); color: rgba(234,242,248,.72); letter-spacing: 3px; margin-bottom: 2vh; }
.sbar-row { display: flex; align-items: center; gap: 1.4vw; margin-bottom: 1.5vh; }
.sbar-name { width: 22%; font-size: clamp(13px, 1.35vw, 21px); color: #DCE7F0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbar-track { flex: 1; height: clamp(14px, 1.6vh, 26px); background: rgba(255,255,255,.09); border-radius: 999px; overflow: hidden; }
.sbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--gold)); transition: width .6s ease; }
.sbar-val { width: 8%; text-align: right; font-size: clamp(15px, 1.6vw, 26px); font-weight: 700; color: var(--gold); }
.sbar-empty { color: rgba(234,242,248,.5); font-size: clamp(15px, 1.6vw, 24px); text-align: center; padding: 4vh 0; }
.screen-foot { display: flex; justify-content: space-between; margin-top: 2vh; font-size: clamp(11px, 1.05vw, 16px); color: rgba(234,242,248,.5); }
.dot-live { color: #35b881; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 720px) {
  .brand .sub { display: none; }
  .brand .mark { max-height: 26px; padding: 2px 6px; }
  .brand { gap: 9px; }
  .hero { padding: 26px 18px 30px; }
  .hero h1 { font-size: 20px; }
  .wrap { padding: 18px 16px 40px; }
  .grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; height: 56px; }
  .brand .name { font-size: 15px; }
  .login-card { padding: 30px 22px 26px; }
  .screen-main { grid-template-columns: 1fr; }
  .screen-depts { display: none; }
  .pnum span { width: 50px; height: 50px; font-size: 18px; }
  .ticket-actions { flex-direction: column; }
}
