:root {
  --blue: #1b5faa;
  --blue-dark: #12457e;
  --blue-light: #e8f0fa;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1f2d3d;
  --muted: #6b7a8f;
  --line: #e2e8f0;
  --green: #1a9c6b;
  --orange: #e08a00;
  --red: #d64545;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(27, 95, 170, 0.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(8, 36, 70, 0.90) 0%, rgba(16, 60, 112, 0.74) 50%, rgba(24, 82, 146, 0.58) 100%),
    url('/img/hero.jpg') center 30% / cover no-repeat;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  padding: 34px 32px 28px;
  box-shadow: 0 18px 50px rgba(0, 20, 50, 0.28);
}
.login-card h1 { font-size: 19px; margin: 0 0 6px; color: var(--blue-dark); line-height: 1.5; }
.login-card .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fbfcfe;
  outline: none;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(27, 95, 170, 0.1);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: 0.15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-ghost { background: var(--blue-light); color: var(--blue); }
.btn-ghost:hover { background: #d9e6f7; }
.btn-danger { background: #fdecec; color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.tip { color: var(--muted); font-size: 12px; margin-top: 14px; text-align: center; }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 8px; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px;
  background: linear-gradient(180deg, #123f70 0%, #1b5faa 100%);
  color: #dce8f7;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 20;
}
.brand { padding: 20px 18px 14px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.brand .logo { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.4; }
.brand .sub { font-size: 11.5px; color: #a9c6e8; margin-top: 4px; }
.nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; margin: 2px 0;
  color: #cfe0f3; text-decoration: none; border-radius: 8px; font-size: 14px;
}
.nav a:hover { background: rgba(255,255,255,0.08); }
.nav a.active { background: rgba(255,255,255,0.16); color: #fff; font-weight: 600; }
.nav .icon { width: 18px; text-align: center; opacity: 0.9; }
.nav .group { padding: 12px 14px 4px; font-size: 11px; color: #8fb3d9; letter-spacing: 1px; }

.main { margin-left: 216px; flex: 1; min-width: 0; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 10;
}
.topbar .title { font-size: 15px; font-weight: 600; color: var(--blue-dark); }
.topbar .user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.content { padding: 20px 22px 40px; }

/* ---------- 卡片与表格 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); border-left: 4px solid var(--blue);
}
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 700; color: var(--blue-dark); margin-top: 6px; }
.stat .v small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stat.green { border-left-color: var(--green); }
.stat.orange { border-left-color: var(--orange); }
.stat.red { border-left-color: var(--red); }

.panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 18px; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { margin: 0; font-size: 14.5px; color: var(--blue-dark); }
.panel-body { padding: 16px 18px; }
.panel-body.no-pad { padding: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; background: #fff; font-family: inherit; color: var(--text);
}
.toolbar .spacer { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f7f9fc; color: var(--muted); font-weight: 600; font-size: 12.5px; }
tbody tr:hover { background: #fafcff; }
td.wrap, th.wrap { white-space: normal; }
.table-scroll { overflow-x: auto; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; line-height: 20px; }
.badge.ok { background: #e6f6ef; color: var(--green); }
.badge.warn { background: #fdf3e2; color: var(--orange); }
.badge.danger { background: #fdecec; color: var(--red); }
.badge.info { background: var(--blue-light); color: var(--blue); }

.empty { text-align: center; color: var(--muted); padding: 36px 0; font-size: 13px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 35, 60, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 560px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,20,50,0.3);
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 15px; color: var(--blue-dark); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.close { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; background: none; border: none; }

/* ---------- 公司简介 ---------- */
.about-hero { position: relative; border-radius: 12px; overflow: hidden; height: 340px; box-shadow: var(--shadow); }
.about-hero img, .about-hero video { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; display: block; }
.about-hero-media { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; display: block; }
.about-hero-mask {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top right, rgba(6,26,52,.92) 0%, rgba(6,26,52,.62) 26%, rgba(6,26,52,.18) 50%, rgba(6,26,52,0) 70%),
    linear-gradient(0deg, rgba(6,26,52,.45) 0%, rgba(6,26,52,0) 32%);
}
.about-hero-text { position: absolute; left: 30px; bottom: 26px; color: #fff; }
.about-hero-text .brand-line { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.about-hero-text .slogan { font-size: 13px; opacity: .88; margin-top: 6px; }
.about-p { margin: 0 0 14px; line-height: 1.9; color: #35465c; font-size: 13.5px; }
.contact-row { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 13px; color: #41526b; border-top: 1px dashed var(--line); padding-top: 14px; }
.contact-row b { color: var(--muted); font-weight: 600; margin-right: 8px; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.adv-card { background: #f7faff; border: 1px solid #e3edf9; border-radius: 10px; padding: 16px 16px 18px; position: relative; }
.adv-no { font-size: 26px; font-weight: 800; color: #cfe0f5; line-height: 1; }
.adv-title { font-size: 14.5px; font-weight: 700; color: var(--blue-dark); margin: 6px 0 8px; }
.adv-desc { font-size: 12.8px; color: #4b5b70; line-height: 1.85; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.svc-card { border-left: 3px solid var(--blue); background: #fff; border-radius: 8px; padding: 14px 16px; box-shadow: 0 1px 6px rgba(27,95,170,.06); }
.svc-title { font-weight: 700; color: var(--blue-dark); margin-bottom: 6px; }
.svc-desc { font-size: 12.8px; color: #4b5b70; line-height: 1.8; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.photo-grid figure { margin: 0; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.photo-grid img { width: 100%; height: auto; aspect-ratio: 2.25 / 1; object-fit: cover; object-position: center; display: block; }
.photo-grid img.ph-team,
.photo-grid img.ph-work { object-position: center; }
.photo-grid figcaption { padding: 10px 14px; font-size: 12.5px; color: var(--muted); }

@media (max-width: 860px) {
  .about-hero { height: 200px; }
  .about-hero-text { left: 16px; bottom: 16px; }
  .about-hero-text .brand-line { font-size: 16px; }
  .photo-grid { grid-template-columns: 1fr; }
  .photo-grid img { height: 180px; }
}

/* ---------- 手机端 ---------- */
.scan-page { min-height: 100vh; background: #f4f6fa; padding: 16px; }
.scan-head { background: linear-gradient(135deg, #123f70, #2f7ac4); color: #fff; border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.scan-head .t { font-size: 15px; font-weight: 600; }
.scan-head .s { font-size: 12px; opacity: 0.85; margin-top: 4px; }
.scan-card { background: #fff; border-radius: 12px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; }
.big-btn { display: flex; gap: 12px; margin: 6px 0 14px; }
.big-btn button {
  flex: 1; padding: 18px 0; font-size: 17px; font-weight: 600; border-radius: 12px;
  border: none; color: #fff; cursor: pointer;
}
.btn-out { background: var(--blue); }
.btn-in { background: var(--green); }
.big-btn button:disabled { opacity: 0.5; }

/* ---------- 「我的」页面 ---------- */
.my-hero {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #1b5faa 0%, #2f7ac4 100%);
  color: #fff; border-radius: 14px; padding: 20px 18px; margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(27, 95, 170, 0.25);
}
.my-hero-admin { background: linear-gradient(135deg, #35507a, #4a6a99); }
.my-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, 0.18);
  display: grid; place-items: center;
  font-size: 18px; font-weight: 700; letter-spacing: 1px;
}
.my-id { flex: 1; min-width: 0; }
.my-name { font-size: 20px; font-weight: 700; }
.my-sub { font-size: 12.5px; opacity: 0.85; margin-top: 4px; }
.my-badge { flex: none; }
.my-badge .badge { background: rgba(255,255,255,.9); color: #12457e; }

.my-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px;
}
.my-stat {
  background: #fff; border-radius: 12px; padding: 14px 8px; text-align: center;
  box-shadow: var(--shadow);
}
.my-stat b { display: block; font-size: 20px; color: var(--blue-dark); font-weight: 700; }
.my-stat span { font-size: 11.5px; color: var(--muted); }

.my-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid #f1f5fa;
}
.my-item:last-child { border-bottom: none; }
.my-item-main { flex: 1; min-width: 0; }
.my-item-title { font-size: 14px; font-weight: 600; color: #23384f; }
.my-item-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.my-item-right { flex: none; }

.my-info { display: grid; gap: 12px; }
.my-info > div { display: flex; justify-content: space-between; gap: 16px; font-size: 13.5px; }
.my-info span { color: var(--muted); flex: none; }
.my-info b { font-weight: 600; text-align: right; }

/* ---------- 更新日志 ---------- */
.timeline { position: relative; padding: 6px 0 6px 0; }
.tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-left { width: 92px; flex: none; text-align: right; padding-top: 12px; }
.tl-date { font-size: 12.5px; color: var(--blue-dark); font-weight: 700; }
.tl-ver { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tl-dot {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
  background: var(--blue); margin-top: 16px;
  box-shadow: 0 0 0 4px rgba(27, 95, 170, 0.14);
  position: relative; z-index: 1;
}
.tl-item::before {
  content: ''; position: absolute; left: 110px; top: 22px; bottom: -4px;
  width: 2px; background: linear-gradient(180deg, #cfe0f5, #eaf1fa);
}
.tl-item:last-child::before { display: none; }
.tl-card {
  flex: 1; min-width: 0; background: #fbfcfe; border: 1px solid #e6eef8;
  border-radius: 12px; padding: 14px 16px;
}
.tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-title { font-size: 14.5px; font-weight: 700; color: #1f2d3d; }
.tl-del { margin-left: auto; }
.tl-list { margin: 10px 0 0; padding-left: 18px; }
.tl-list li { font-size: 13px; line-height: 1.85; color: #3c4b60; }

@media (max-width: 860px) {
  .timeline { padding-left: 0; }
  .tl-item { flex-direction: column; gap: 6px; padding-left: 18px; }
  .tl-left { width: auto; text-align: left; padding-top: 0; display: flex; gap: 8px; align-items: center; }
  .tl-dot { position: absolute; left: 0; top: 6px; margin-top: 0; }
  .tl-item::before { left: 5px; top: 18px; }
  .tl-card { padding: 12px 14px; }
}

/* ---------- 平板 ---------- */
@media (max-width: 1200px) and (min-width: 861px) {
  .sidebar { width: 190px; }
  .main { margin-left: 190px; }
  .content { padding: 16px; }
  .my-stats { gap: 8px; }
}

/* ---------- 手机 / 小屏平板：侧栏变底部导航 ---------- */
@media (max-width: 860px) {
  .app { display: block; }
  .sidebar {
    display: flex; flex-direction: row;
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: auto; height: 62px;
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -2px 12px rgba(20, 45, 80, 0.08);
    z-index: 30;
  }
  .sidebar .brand { display: none; }
  .sidebar .nav {
    display: flex; flex-direction: row; align-items: stretch;
    width: 100%; padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .sidebar .nav .group { display: none; }
  .sidebar .nav a {
    flex: 1 0 auto; min-width: 62px;
    flex-direction: column; justify-content: center; gap: 2px;
    padding: 8px 6px; margin: 0; border-radius: 0;
    font-size: 11px; color: #5b6b80;
  }
  .sidebar .nav a.active { background: #eef4fc; color: var(--blue); font-weight: 600; }
  .sidebar .nav a .icon { font-size: 18px; }

  .main { margin-left: 0; padding-bottom: 68px; }
  .content { padding: 12px 12px 20px; }
  .topbar { height: 52px; padding: 0 12px; }
  .topbar .title { font-size: 14.5px; }
  .topbar .user span:not(#userName):not(#userAvatar) { display: none; }
  .grid2 { grid-template-columns: 1fr; }

  .my-stats { grid-template-columns: repeat(2, 1fr); }
  .my-hero { padding: 16px 14px; border-radius: 12px; }
  .my-name { font-size: 18px; }
  .my-item { padding: 12px 14px; }

  .toolbar input, .toolbar select { flex: 1 1 45%; }
  table { font-size: 12.5px; }
  th, td { padding: 9px 10px; }
  .modal { max-width: 100%; }
  .btn { padding: 10px 14px; }
  .btn-sm { padding: 8px 12px; font-size: 13px; }
}
