:root {
  --ink: #252827;
  --muted: #6f716d;
  --paper: #fbf8f1;
  --card: #fffefa;
  --line: #e9dfd1;
  --accent: #c83e28;
  --accent-dark: #a83224;
  --accent-soft: #ffe3d8;
  --green: #087f73;
  --green-soft: #d9f3ea;
  --yellow: #925700;
  --yellow-soft: #fff1bd;
  --shadow: 0 16px 42px rgba(120, 62, 34, 0.11);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 0%, rgba(240, 115, 54, 0.13), transparent 29rem),
    radial-gradient(circle at 10% 32%, rgba(28, 155, 137, 0.055), transparent 25rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 242px 1fr; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 30px 20px 22px;
  background: rgba(255, 253, 250, 0.88);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow-y: auto;
}

.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 28px; }
.brand-mark {
  position: relative; flex: 0 0 52px; width: 52px; height: 52px; overflow: hidden;
  border-radius: 12px; background: #fffefa; border: 1px solid var(--line);
  box-shadow: 0 6px 14px rgba(45, 75, 103, 0.09);
}
.brand-mark img { position: absolute; width: 82px; max-width: none; height: auto; left: -14px; top: -6px; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: "Songti SC", serif; font-size: 18px; letter-spacing: .02em; white-space: nowrap; }
.brand small { color: var(--muted); margin-top: 2px; font-size: 11px; letter-spacing: .08em; }

.nav-list { display: grid; gap: 7px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  color: #665f57; font-size: 14px; font-weight: 600;
}
.nav-item span { width: 22px; font-size: 18px; text-align: center; font-weight: 400; }
.nav-item:hover { background: #fff0c9; }
.nav-item.active { color: var(--accent-dark); background: var(--accent-soft); }
.access-hidden { display: none !important; }

.sidebar-note {
  margin-top: auto; padding: 14px;
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 13px;
  background: #fbf8f3;
}
.status-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #0f9a79; box-shadow: 0 0 0 4px #d9f3e8; }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { color: var(--muted); margin-top: 4px; font-size: 10px; line-height: 1.45; }
.sidebar-credit { padding: 12px 10px 0; color: var(--muted); font-size: 10px; }
.sidebar-credit span,.sidebar-credit strong,.sidebar-credit small { display:block; }
.sidebar-credit strong { margin-top:4px; color:var(--ink); font-size:12px; }
.sidebar-credit small { margin-top:2px; font-size:10px; }

.main { min-width: 0; }
.topbar {
  height: 78px; padding: 0 38px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 15;
  background: rgba(251, 248, 241, 0.84); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(233, 223, 209, 0.78);
}
.topbar-title { font-family: "Songti SC", serif; font-size: 18px; font-weight: 700; letter-spacing: .04em; }
.topbar-actions { display: flex; gap: 10px; }
.mobile-menu { display: none; }

.content { width: min(1160px, calc(100% - 64px)); margin: 0 auto; padding: 42px 0 70px; }
.login-panel { max-width:680px; margin-top:20px; }
.login-panel .lead { margin-bottom:18px; }
.login-form { display:grid; gap:14px; justify-items:start; }
.login-form label { width:min(100%, 420px); }
.login-form .help-text { margin:0; }
.login-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.login-help { max-width:560px; color:var(--muted); font-size:14px; line-height:1.7; }
.login-help summary { cursor:pointer; color:var(--ink); }
.login-help p { margin:8px 0 0; }
.login-help .login-form { margin-top:14px; }
.password-settings { margin-top:18px; }
.first-admin-note { max-width:560px; margin:16px 0; padding:15px 17px; border:1px solid #e7c48d; border-radius:12px; background:#fff7e8; }
.first-admin-note strong { color:#704500; font-size:14px; }
.first-admin-note p { margin:6px 0 0; color:#6e604d; font-size:12px; line-height:1.7; }
.preview-banner { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 18px; margin-bottom:22px; border:1px solid #e4b988; border-radius:14px; background:#fff5df; }
.preview-banner strong,.preview-banner span { display:block; }
.preview-banner strong { font-size:13px; color:#704500; }
.preview-banner span { margin-top:4px; color:#755f40; font-size:11px; line-height:1.5; }
button:disabled { cursor:not-allowed; opacity:.48; transform:none !important; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: "Songti SC", serif; }
h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.2; margin-bottom: 12px; }
h2 { font-size: 25px; margin-bottom: 10px; }
h3 { font-size: 15px; }
.lead { max-width: 680px; color: var(--muted); font-size: 15px; line-height: 1.8; }

.hero {
  position: relative; overflow: hidden;
  padding: 40px 42px; margin-bottom: 26px;
  color: #fff; border-radius: 24px;
  background: linear-gradient(118deg, #ae3028 0%, #df452d 48%, #f28a38 100%);
  box-shadow: 0 18px 48px rgba(194, 66, 40, 0.23);
}
.hero::after {
  content: ""; position: absolute; width: 330px; height: 330px; right: -90px; top: -160px;
  border: 55px solid rgba(255,255,255,.09); border-radius: 50%;
}
.hero .eyebrow { color: #ffe2d1; }
.hero h1 { max-width: 620px; margin-top: 11px; }
.hero p { max-width: 600px; color: rgba(255,255,255,.78); line-height: 1.75; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 10px; position: relative; z-index: 1; }

.button {
  border: 0; border-radius: 11px; padding: 10px 16px;
  font-weight: 700; font-size: 13px; transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--accent); box-shadow: 0 7px 17px rgba(200, 62, 40, .25); }
.button.ghost { color: #72500e; background: #fff0c9; }
.button.light { color: var(--accent-dark); background: #fff; }
.button.outline-light { color: #fff; background: transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.42); }
.button.danger { color: #a13f2c; background: #f6dfd9; }
.button.small { padding: 7px 10px; font-size: 11px; border-radius: 8px; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: 21px; }
.icon-button:hover { background: #ffe9cf; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 34px; }
.stat-card { padding: 21px 22px; background: rgba(255,253,250,.9); border: 1px solid var(--line); border-radius: var(--radius); }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin-top: 7px; font: 700 29px/1 "Songti SC", serif; }
.stat-card em { display: inline-block; margin-top: 10px; padding: 4px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 10px; font-style: normal; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 30px 0 15px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.search { width: 250px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fffdfa; outline: none; }
.search:focus, input:focus, textarea:focus, select:focus { border-color: #e15b3c; box-shadow: 0 0 0 3px rgba(216,75,50,.14); outline: none; }

.activity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.activity-card {
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); box-shadow: 0 8px 24px rgba(76,60,45,.045);
  transition: .2s ease;
}
.activity-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #efb19a; }
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.date-tile { flex: 0 0 auto; width: 51px; padding: 7px 0; text-align: center; border-radius: 11px; color: var(--accent-dark); background: var(--accent-soft); }
.date-tile strong, .date-tile span { display: block; }
.date-tile strong { font: 700 21px/1.1 "Songti SC", serif; }
.date-tile span { margin-top: 3px; font-size: 9px; font-weight: 700; }
.card-title { flex: 1; min-width: 0; }
.card-title h3 { font-size: 17px; margin: 2px 0 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title p { color: var(--muted); font-size: 11px; margin: 0; }
.badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge.progress { color: var(--yellow); background: var(--yellow-soft); }
.badge.done { color: var(--green); background: var(--green-soft); }
.badge.draft { color: #736c64; background: #ebe7e1; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 19px 0; color: #77716a; font-size: 11px; }
.progress-line { height: 5px; background: #eee9e2; border-radius: 99px; overflow: hidden; }
.progress-line span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.progress-label { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 10px; }

.empty-state { padding: 58px 20px; text-align: center; border: 1px dashed #d9cfc4; border-radius: var(--radius); background: rgba(255,253,250,.55); }
.empty-icon { width: 65px; height: 65px; margin: 0 auto 17px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: var(--accent-soft); font-size: 26px; }
.empty-state h3 { font: 700 20px/1.3 "Songti SC", serif; margin-bottom: 8px; }
.empty-state p { color: var(--muted); font-size: 13px; }

.detail-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.detail-hero h1 { margin: 8px 0; font-size: 34px; }
.folder-name { display: inline-block; max-width: 100%; padding: 8px 11px; border-radius: 8px; background: #ebe5dc; color: #665d55; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.detail-actions { display: flex; align-items: start; gap: 8px; }
.step-nav { display: flex; gap: 6px; overflow-x: auto; padding: 21px 0 16px; }
.step-button { border: 0; padding: 9px 12px; border-radius: 9px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; white-space: nowrap; }
.step-button.active { color: var(--accent-dark); background: var(--accent-soft); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 25px; box-shadow: 0 7px 24px rgba(76,60,45,.04); }
.panel + .panel { margin-top: 15px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-head h2, .panel-head h3 { margin-bottom: 5px; }
.panel-head p { color: var(--muted); font-size: 12px; margin: 0; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
label { display: grid; gap: 7px; color: #5e5851; font-size: 12px; font-weight: 700; }
label.span-2, .span-2 { grid-column: 1 / -1; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; color: var(--ink); background: #fffefc;
  font-size: 13px; font-weight: 400;
}
textarea { min-height: 112px; resize: vertical; line-height: 1.65; }
.help-text { color: var(--muted); font-size: 11px; line-height: 1.6; }

.check-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.check-group { padding: 17px; border-radius: 14px; background: #faf7f2; border: 1px solid #ece5dc; }
.check-group h3 { display: flex; justify-content: space-between; margin-bottom: 12px; }
.check-group h3 span { color: var(--muted); font-size: 10px; font-weight: 500; }
.check-item { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; color: #5e5851; font-size: 12px; font-weight: 500; line-height: 1.45; }
.check-item input { appearance: none; width: 17px; height: 17px; flex: 0 0 auto; margin: 0; padding: 0; border-radius: 5px; background: #fff; }
.check-item input:checked { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px #fff; }
.check-item.done { color: #9a948d; text-decoration: line-through; }

.upload-zone { padding: 25px; text-align: center; border: 1.5px dashed #d5c8bb; border-radius: 14px; background: #faf7f2; }
.upload-zone strong { display: block; margin-bottom: 6px; }
.upload-zone p { margin-bottom: 14px; color: var(--muted); font-size: 11px; }
.media-list { display: grid; gap: 8px; margin-top: 17px; }
.media-row { display: grid; grid-template-columns: minmax(150px,1.3fr) repeat(3,minmax(105px,.7fr)) 80px 30px; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.media-row .media-name { grid-column: 1 / -1; }
.media-row .media-tags-input { grid-column: 1 / 5; padding: 7px 9px; font-size: 10px; }
.media-row select { padding: 7px; font-size: 10px; }
.media-name { min-width: 0; }
.media-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.media-name small { color: var(--muted); font-size: 10px; }
.media-row select { padding: 7px; font-size: 10px; }
.privacy-toggle { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 500; }
.privacy-toggle input { width: 15px; height: 15px; }
.remove-media { border: 0; background: transparent; color: #a74d36; font-size: 18px; }

.backup-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.backup-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #faf7f2; }
.backup-card input { appearance: none; width: 22px; height: 22px; flex: 0 0 auto; padding: 0; border-radius: 7px; background: #fff; }
.backup-card input:checked { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 4px #fff; }
.backup-card strong, .backup-card small { display: block; }
.backup-card strong { font-size: 12px; }
.backup-card small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.warning { margin-top: 14px; padding: 13px 15px; border-radius: 11px; color: #7a5421; background: var(--yellow-soft); font-size: 11px; line-height: 1.6; }

.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.guide-card { padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.guide-number { color: var(--accent); font: 700 30px/1 "Songti SC", serif; opacity: .65; }
.guide-card h3 { margin: 15px 0 8px; font-size: 15px; }
.guide-card p { color: var(--muted); font-size: 11px; line-height: 1.7; }
.folder-tree { padding: 20px; overflow: auto; border-radius: 14px; background: #292623; color: #eee7de; font: 11px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }

.settings-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.privacy-note { display: flex; gap: 15px; padding: 20px; border-radius: 15px; background: var(--green-soft); color: #31594a; }
.privacy-note span { font-size: 25px; }
.privacy-note h3 { margin-bottom: 5px; }
.privacy-note p { margin: 0; font-size: 11px; line-height: 1.65; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(35,31,27,.48); backdrop-filter: blur(5px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(600px, 100%); padding: 26px; border-radius: 21px; background: var(--card); box-shadow: 0 30px 90px rgba(35,31,27,.25); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 21px; }
.modal-header h2 { margin: 6px 0 0; }
.folder-preview { margin-top: 17px; padding: 13px; border-radius: 11px; background: #f3eee7; }
.folder-preview span, .folder-preview code { display: block; }
.folder-preview span { color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.folder-preview code { color: var(--accent-dark); word-break: break-all; font-size: 11px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }

.toast { position: fixed; right: 25px; bottom: 25px; z-index: 80; padding: 12px 16px; color: #fff; background: #302c28; border-radius: 11px; box-shadow: var(--shadow); font-size: 12px; }
.toast[hidden] { display: none; }

.cloud-state { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,253,250,.7); font-size: 10px; white-space: nowrap; }
.cloud-state i { width: 7px; height: 7px; border-radius: 50%; background: #b6a99a; }
.cloud-state.online i { background: #4e8a6c; box-shadow: 0 0 0 3px #dfede5; }
.sync-strip { display:flex; justify-content:space-between; gap:12px; padding:12px 15px; margin-bottom:26px; border-radius:11px; color:#4d6458; background:#e8efe9; font-size:11px; }
.team-motto { padding:25px 28px; margin:22px 0; border-radius:17px; border-left:4px solid var(--accent); background:linear-gradient(105deg,#fff0d0,#ffe4d8 72%,#e2f5ec); }
.team-motto span { color:var(--accent-dark); font-size:11px; font-weight:800; letter-spacing:.08em; }
.team-motto p { margin:9px 0 0; color:#534b43; font:16px/1.8 "Songti SC",serif; }
.department-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
.department-card { position:relative; padding:21px; overflow:hidden; border:1px solid var(--line); border-radius:15px; background:var(--card); }
.department-index { float:right; color:#e4d6c8; font:700 30px/1 "Songti SC",serif; }
.department-card h3 { margin:0 0 9px; color:var(--accent-dark); }
.department-card p { margin:0; color:var(--muted); font-size:11px; line-height:1.7; }
.roster-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.roster-team-photo { max-width:760px; margin:0 auto 16px; overflow:hidden; border-radius:14px; background:var(--card); }
.roster-team-photo img { display:block; width:100%; max-height:390px; object-fit:cover; object-position:center 48%; }
.roster-team-photo figcaption { padding:8px 12px; color:var(--muted); font-size:10px; }
.roster-photo-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:10px; margin:0 auto 16px; }
.roster-photo-grid figure { min-width:0; overflow:hidden; margin:0; border-radius:12px; background:#fffdfa; }
.roster-photo-grid img { display:block; width:100%; aspect-ratio:4 / 3; object-fit:cover; object-position:center 40%; }
.roster-photo-grid figcaption { padding:7px 9px; color:var(--muted); font-size:10px; }
.roster-person { padding:20px; border:1px solid var(--line); border-radius:14px; background:#fffdfa; }
.roster-role { color:var(--accent-dark); font-size:10px; font-weight:800; letter-spacing:.08em; }
.roster-person h3 { margin:7px 0 0; font:700 20px "Songti SC",serif; }
.roster-person p { margin:10px 0 0; color:var(--muted); font-size:11px; line-height:1.75; }
.department-people { display:flex; flex-wrap:wrap; gap:7px; margin-top:14px; }
.department-people span { display:inline-flex; align-items:baseline; gap:6px; padding:6px 9px; border-radius:8px; background:var(--accent-soft); color:var(--accent-dark); }
.department-people small { font-size:9px; }
.department-people strong { font-size:11px; }
.team-facts { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:20px 0; }
.team-facts article { padding:17px; border:1px solid var(--line); border-radius:13px; background:#fffdfa; }
.team-facts span,.team-facts strong,.team-facts small { display:block; }
.team-facts span { color:var(--muted); font-size:10px; }
.team-facts strong { margin:8px 0 5px; font:700 17px "Songti SC",serif; }
.team-facts small { color:#938b82; font-size:10px; line-height:1.55; }
.team-content-section { margin-top:16px; }
.team-about { color:var(--muted); font-size:12px; line-height:1.85; }
.team-about h3 { color:var(--ink); font:700 19px "Songti SC",serif; margin:0 0 10px; }
.team-about p { margin:8px 0; }
.team-established { color:var(--muted); font-size:12px; margin-top:-8px; }
.keyword-list { display:flex; flex-wrap:wrap; gap:7px; margin-top:14px; }
.keyword-list span { border-radius:30px; padding:5px 10px; background:#f2e8dd; color:var(--accent-dark); font-size:10px; }
.content-references { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:12px; color:#958b80; font-size:10px; }
.content-references a,.content-references span { color:var(--accent-dark); text-decoration:underline; text-underline-offset:2px; }
.department-card ul { margin:12px 0 0; padding-left:17px; color:var(--muted); font-size:11px; line-height:1.8; }
.team-record-list { display:grid; gap:12px; }
.team-timeline { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(250px, 280px); grid-template-rows:auto 72px auto; gap:0 22px; overflow-x:auto; padding:12px 8px 18px; scroll-snap-type:x mandatory; scrollbar-color:#d88968 #f3e7dc; scrollbar-width:thin; }
.team-record { display:grid; grid-template-columns:92px minmax(0,1fr); gap:14px; padding:16px 0; border-bottom:1px solid var(--line); }
.team-record-list .team-record { grid-template-columns:1fr; }
.team-timeline .timeline-record { position:relative; display:flex; flex-direction:column; min-width:0; min-height:0; padding:13px; border:1px solid var(--line); border-bottom:1px solid var(--line); border-radius:15px; background:var(--card); box-shadow:0 7px 20px #49351a0a; scroll-snap-align:start; }
.team-timeline .timeline-upper { align-self:end; }
.team-timeline .timeline-lower { align-self:start; }
.team-timeline .timeline-record::before { position:absolute; left:50%; width:calc(100% + 22px); height:2px; background:linear-gradient(90deg,#d9a38d,#e8c6a9); content:""; transform-origin:left center; }
.team-timeline .timeline-upper::before { top:calc(100% - 1px); transform:rotate(14deg); }
.team-timeline .timeline-lower::before { top:-1px; transform:rotate(-14deg); }
.team-timeline .timeline-record:last-child::before { display:none; }
.team-timeline .timeline-record::after { position:absolute; z-index:1; left:calc(50% - 6px); width:12px; height:12px; border:3px solid var(--paper); border-radius:50%; background:var(--accent); box-shadow:0 0 0 1px var(--accent); content:""; }
.team-timeline .timeline-upper::after { top:calc(100% - 7px); }
.team-timeline .timeline-lower::after { top:-6px; }
.timeline-date { position:absolute; z-index:2; left:calc(50% + 14px); display:inline-flex; align-items:center; min-height:24px; padding:4px 9px; border:1px solid #e7c7b6; border-radius:20px; background:var(--paper); color:var(--accent-dark) !important; font-size:10px !important; font-weight:800 !important; white-space:nowrap; box-shadow:0 2px 8px #49351a10; transform:translateY(-50%); }
.timeline-upper .timeline-date { top:calc(100% - 1px); }
.timeline-lower .timeline-date { top:-1px; }
.timeline-media { position:relative; display:grid; width:100%; aspect-ratio:16 / 9; place-items:center; overflow:hidden; margin:0 0 12px; border-radius:10px; background:#edf1e8; }
.timeline-media img { display:block; width:100%; height:100%; object-fit:cover; }
.timeline-photo-slot { border:1px dashed #c9d6c2; background:linear-gradient(135deg,#edf3e8,#f7efe4 72%); color:#75856d; }
.timeline-photo-slot::before,.timeline-photo-slot::after { position:absolute; border:1px solid #d7e0d0; border-radius:50%; content:""; }
.timeline-photo-slot::before { width:54px; height:54px; right:16px; top:-28px; }
.timeline-photo-slot::after { width:32px; height:32px; left:18px; bottom:-17px; }
.timeline-photo-slot span { position:relative; z-index:1; display:inline-flex; align-items:center; gap:6px; padding:5px 9px; border-radius:20px; background:#ffffffb8; color:#788772; font-size:10px; letter-spacing:.04em; }
.timeline-photo-slot span::before { width:13px; height:10px; border:1px solid currentColor; border-radius:2px; content:""; }
.timeline-copy { min-width:0; }
.timeline-record>div { min-width:0; }
.timeline-record h3 { margin:0 0 8px; color:var(--ink); }
.timeline-hint { margin:0 2px; color:var(--muted); font-size:10px; }
.team-record:last-child { border-bottom:0; }
.team-record>span,.team-record>div>span { color:var(--accent-dark); font-size:11px; font-weight:700; }
.team-record h3 { margin:4px 0 7px; font:700 16px "Songti SC",serif; }
.team-record p { margin:5px 0; color:var(--muted); font-size:11px; line-height:1.7; }
.team-record small { color:#958b80; }
.footprint-layout { display:grid; grid-template-columns:minmax(0,1fr) 238px; gap:18px; align-items:start; }
.footprint-map { min-width:0; overflow-x:auto; }
.footprint-map-canvas { position:relative; overflow:hidden; border-radius:18px; background:#233a32; box-shadow:0 12px 28px rgba(35,132,159,.14); }
.footprint-map svg { display:block; width:100%; min-width:560px; height:auto; border-radius:18px; cursor:grab; touch-action:none; user-select:none; }
.footprint-map svg.is-panning { cursor:grabbing; }
.footprint-map-bg { fill:#233a32; }
.satellite-tiles { pointer-events:none; }
.satellite-tiles image { image-rendering:auto; }
.satellite-fallback-note { position:absolute; bottom:12px; left:12px; z-index:2; padding:7px 10px; border-radius:8px; color:#344f40; background:rgba(255,255,255,.9); font-size:11px; }
.satellite-fallback-note[hidden] { display:none; }
.footprint-map-canvas.satellite-unavailable .footprint-map-bg { fill:#bcebf4; }
.footprint-map-canvas.satellite-unavailable .province-shape { fill:#b9e2bd; stroke:#fff; }
.footprint-map-canvas.satellite-unavailable .province-shape.special-admin-shape { fill:#b9e2bd; stroke:#287e73; }
.footprint-map-canvas.satellite-unavailable .province-boundary { stroke:#287e73; filter:none; }
.footprint-map-canvas.satellite-unavailable .footprint-grid text { fill:#17677e; stroke:#f2ffff; }
.footprint-map-canvas.satellite-unavailable .province-label,.footprint-map-canvas.satellite-unavailable .special-admin-label { fill:#285c4b; stroke:#f4fff0; }
.province-shapes,.province-boundaries { pointer-events:none; }
.province-shape { fill:rgba(110,220,151,.1); stroke:rgba(255,255,255,.9); stroke-width:.85; vector-effect:non-scaling-stroke; }
.province-shape.special-admin-shape { fill:rgba(34,220,185,.28); stroke:#fff; stroke-width:1.4; vector-effect:non-scaling-stroke; }
.province-boundary { fill:none; stroke:rgba(255,255,255,.9); stroke-width:1.1; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; filter:drop-shadow(0 0 1px rgba(0,0,0,.85)); }
.province-boundary.statistical { stroke:#d17a35; stroke-dasharray:3 3; }
.footprint-grid line { stroke:#c2edf0; stroke-width:.8; stroke-dasharray:2.5 6; opacity:.2; }
.footprint-grid line.major { stroke-width:1; opacity:.36; }
.footprint-grid text { fill:#fff; font-size:11px; font-weight:700; paint-order:stroke; stroke:rgba(0,0,0,.8); stroke-width:2.5px; }
.province-labels { opacity:0; transition:opacity .18s ease; pointer-events:none; }
.footprint-map svg.is-detailed .province-labels { opacity:1; }
.province-label { fill:#fff; font:800 10px "Songti SC",serif; paint-order:stroke; stroke:rgba(0,0,0,.82); stroke-width:3px; stroke-linejoin:round; }
.special-admin-label { fill:#fff; font:800 10px "Songti SC",serif; paint-order:stroke; stroke:rgba(0,0,0,.9); stroke-width:3px; stroke-linejoin:round; }
.footprint-map-controls { position:absolute; top:12px; right:12px; display:flex; align-items:center; gap:5px; padding:5px; border:1px solid rgba(255,255,255,.72); border-radius:13px; background:rgba(255,255,255,.88); box-shadow:0 5px 18px rgba(24,86,104,.16); backdrop-filter:blur(8px); }
.footprint-map-controls button { min-width:34px; height:32px; border:0; border-radius:9px; color:#fff; background:#e45437; font-weight:800; }
.footprint-map-controls button:hover { background:#b93229; }
.footprint-map-controls button[data-map-zoom="reset"] { min-width:45px; color:#126a74; background:#d9f3e9; font-size:11px; }
.footprint-map-controls span { min-width:42px; padding:0 4px; color:#315860; font-size:10px; font-weight:800; text-align:center; }
.footprint-map-hint { margin:9px 0 0 !important; color:#276d79 !important; font-size:10px !important; font-weight:700; }
.footprint-map>p { margin:6px 0 0; color:var(--muted); font-size:10px; line-height:1.6; }
.footprint-map-legend { display:flex; flex-wrap:wrap; align-items:center; gap:7px 14px; margin-top:8px; color:#376b6f; font-size:10px; }
.footprint-map-legend span { display:inline-flex; align-items:center; gap:5px; font-weight:700; }
.footprint-map-legend i { display:inline-block; width:18px; border-top:2px solid #287e73; }
.footprint-map-legend i.statistical { border-top:2px dashed #d17a35; }
.footprint-map-legend i.coordinate-grid { border-top:1px dashed #4a9eb1; }
.footprint-map-legend small { color:var(--muted); font-size:10px; }
.footprint-map-legend a { color:#276d79; text-decoration:underline; text-underline-offset:2px; }
.footprint-marker { cursor:pointer; outline:none; }
.marker-connector-halo,.marker-connector { fill:none; stroke-linecap:round; pointer-events:none; }
.marker-connector-halo { stroke:#fff; stroke-width:4; opacity:.9; }
.marker-connector { stroke:#c65a43; stroke-width:1.25; stroke-dasharray:2.5 2; }
.marker-anchor { fill:#c65a43; stroke:#fff; stroke-width:1; pointer-events:none; }
.marker-pin { filter:drop-shadow(0 1px 1px rgba(59,58,45,.24)); }
.footprint-marker .marker-halo { fill:#fff3a8; opacity:.92; }
.footprint-marker .marker-core { fill:#ec4932; stroke:#fff; stroke-width:1.25; }
.footprint-marker.broad .marker-core { fill:#8b49bd; }
.footprint-marker .marker-hole { fill:#fff; pointer-events:none; }
.footprint-marker text { fill:#d63b2d; font:800 6px sans-serif; pointer-events:none; }
.footprint-marker.broad text { fill:#7543a2; }
.footprint-marker:hover .marker-halo,.footprint-marker.active .marker-halo,.footprint-marker:focus-visible .marker-halo { fill:#ffe45e; opacity:1; }
.footprint-marker.active .marker-core,.footprint-marker:focus-visible .marker-core { stroke:#173f59; stroke-width:2; }
.footprint-side { display:grid; gap:12px; min-width:0; }
.footprint-place-list { display:grid; gap:6px; max-height:296px; overflow-y:auto; }
.footprint-place-list button { display:flex; align-items:center; gap:9px; width:100%; padding:8px; border:1px solid var(--line); border-radius:10px; background:#fffdfa; color:var(--ink); text-align:left; cursor:pointer; }
.footprint-place-list button:hover,.footprint-place-list button.active { border-color:#58b9b1; background:#e2f7f1; }
.footprint-place-list b { display:grid; place-items:center; flex:0 0 25px; width:25px; height:25px; border-radius:50%; background:#e45437; color:#fff; font-size:11px; }
.footprint-place-list strong,.footprint-place-list small { display:block; }
.footprint-place-list strong { font-size:11px; }
.footprint-place-list small { margin-top:2px; color:var(--muted); font-size:9px; }
.footprint-detail { padding:14px; border:1px solid #c9eee4; border-radius:11px; background:linear-gradient(135deg,#effbf5,#fff5dc); }
.footprint-detail>span { color:#477e79; font-size:10px; }
.footprint-detail h3 { margin:5px 0 7px; font:700 18px "Songti SC",serif; }
.footprint-detail>strong { color:#c14455; font-size:11px; }
.footprint-detail p { margin:7px 0 0; color:var(--muted); font-size:11px; line-height:1.7; }
.empty-inline { padding:15px; border:1px dashed #d9cfc4; border-radius:11px; color:var(--muted); background:#faf7f2; font-size:11px; line-height:1.7; }
.member-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.member-card { display:flex; align-items:center; gap:10px; padding:11px; border:1px solid var(--line); border-radius:11px; }
.member-avatar { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; color:var(--accent-dark); background:var(--accent-soft); font-weight:800; }
.member-card strong,.member-card small { display:block; }
.member-card strong { font-size:11px; }
.member-card small { margin-top:3px; color:var(--muted); font-size:9px; }
.member-card select { width:auto; max-width:120px; margin-left:auto; padding:6px; font-size:10px; }
.accounts-panel { max-width:960px; margin-top:18px; }
.account-list { display:grid; gap:12px; }
.account-row { display:flex; flex-wrap:wrap; justify-content:space-between; gap:16px; padding:16px; border:1px solid var(--line); border-radius:12px; background:#fffefa; }
.account-identity { display:grid; justify-items:start; align-content:start; gap:5px; min-width:180px; }
.account-identity strong { font-size:14px; }
.account-identity small { color:var(--muted); font-size:11px; overflow-wrap:anywhere; }
.account-controls { display:flex; flex-wrap:wrap; align-items:start; gap:10px; }
.account-controls label { display:grid; gap:5px; color:var(--muted); font-size:11px; }
.account-controls select { min-width:115px; }
.account-reset { min-width:135px; }
.account-reset summary { padding:10px; border:1px solid var(--line); border-radius:9px; cursor:pointer; font-size:11px; }
.account-reset[open] { width:min(100%, 270px); }
.account-reset .login-form { padding:12px 0; }
.library-toolbar { display:grid; grid-template-columns:repeat(4,minmax(120px,1fr)); gap:9px; margin-bottom:16px; }
.library-toolbar select { padding:9px; font-size:11px; }
.library-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px; }
.library-item { overflow:hidden; border:1px solid var(--line); border-radius:12px; background:#fff; }
.media-placeholder { min-height:115px; display:grid; place-items:center; position:relative; color:#bf7955; background:linear-gradient(135deg,#f4e6d9,#e6eee8); }
.media-placeholder span { font-size:27px; }
.media-placeholder small { position:absolute; left:8px; bottom:7px; padding:4px 6px; border-radius:6px; background:rgba(255,255,255,.8); font-size:9px; }
.library-item-info { padding:11px; }
.library-item-info>strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.library-item-info>a { display:block; margin-top:5px; overflow:hidden; color:var(--muted); text-overflow:ellipsis; white-space:nowrap; font-size:9px; }
.library-tags { display:flex; flex-wrap:wrap; gap:4px; margin-top:8px; }
.library-tags span { color:#92704e; font-size:9px; }
.library-meta { display:flex; justify-content:space-between; align-items:center; margin-top:8px; color:#bd8c3d; font-size:10px; }
.privacy-pill { padding:4px 6px; border-radius:999px; color:#655f58; background:#ebe7e1; font-size:9px; }
.privacy-pill.public { color:#356650; background:#dcebe2; }
.privacy-pill.pending { color:#986b25; background:#f5ebd8; }
.privacy-pill.private { color:#a03e30; background:#f4e0dc; }
.privacy-pill.team_only { color:#455d7e; background:#e2e9f0; }
.simple-list { display:grid; }
.simple-list a { display:flex; justify-content:space-between; gap:15px; padding:12px 0; border-bottom:1px solid var(--line); font-size:11px; }
.simple-list a:last-child { border:0; }
.simple-list span { color:var(--muted); }
.release-list { display:grid; gap:15px; max-width:850px; margin-top:26px; }
.release-card { padding:26px 28px; }
.release-meta { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.release-meta time { color:var(--muted); font-size:12px; }
.release-card h2 { margin:0 0 4px; }
.release-version { color:var(--accent-dark); font-size:12px; font-weight:700; margin-bottom:14px; }
.release-summary { color:var(--muted); font-size:13px; line-height:1.75; }
.release-changes { margin:16px 0 0; padding-left:20px; color:#5f5851; font-size:12px; line-height:1.85; }
.release-changes li + li { margin-top:7px; }
.release-author { max-width:850px; margin-top:16px; padding:24px 28px; }
.release-author h2 { margin-bottom:12px; font-size:21px; }
.release-author p { display:flex; flex-wrap:wrap; align-items:baseline; gap:10px; margin:0; }
.release-author strong { font:700 20px "Songti SC",serif; }
.release-author span { color:var(--muted); font-size:13px; }

@media (max-width: 1100px) {
  .footprint-layout { grid-template-columns:1fr; }
  .footprint-place-list { grid-template-columns:repeat(2,minmax(0,1fr)); max-height:none; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; transition: .22s ease; box-shadow: var(--shadow); }
  .sidebar.open { left: 0; }
  .mobile-menu { display: inline-grid; place-items: center; }
  .topbar { padding: 0 20px; }
  .topbar-title { margin-right: auto; margin-left: 8px; }
  .content { width: min(100% - 32px, 760px); padding-top: 27px; }
  .activity-grid, .check-groups, .guide-grid { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-actions { flex-wrap: wrap; }
  .library-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .team-stats { grid-template-columns:repeat(3,1fr); }
}

@media (max-width: 600px) {
  .preview-banner { align-items:flex-start; flex-direction:column; }
  .topbar { height: 66px; }
  .topbar-title { font-size: 15px; }
  .topbar .button { padding: 9px 11px; }
  #installButton { display: none !important; }
  .hero { padding: 29px 24px; }
  .hero h1 { font-size: 29px; }
  .hero-actions { flex-wrap: wrap; }
  .stats-grid { grid-template-columns: 1fr; gap: 9px; }
  .stat-card { padding: 16px 18px; }
  .activity-grid { grid-template-columns: 1fr; }
  .section-head { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .form-grid, .backup-grid { grid-template-columns: 1fr; }
  label.span-2, .span-2 { grid-column: auto; }
  .media-row { grid-template-columns:repeat(2,minmax(0,1fr)) 30px; }
  .media-row .media-name { grid-column: 1 / -1; }
  .media-row .media-tags-input { grid-column: 1 / 3; }
  .modal { padding: 21px; }
  .cloud-state { display:none; }
  .department-grid,.team-facts,.roster-grid { grid-template-columns:1fr; }
  .footprint-place-list { grid-template-columns:1fr; }
  .team-timeline { grid-auto-columns:minmax(240px,min(82vw,280px)); gap:0 18px; }
  .team-record { grid-template-columns:1fr; gap:5px; }
  .member-grid { grid-template-columns:1fr; }
  .library-toolbar { grid-template-columns:1fr; }
  .library-grid { grid-template-columns:1fr; }
  .team-stats { grid-template-columns:1fr; }
  .sync-strip { flex-direction:column; }
}
