:root {
  --ink: #101110;
  --ink-2: #1c1d1b;
  --ink-3: #30322f;
  --paper: #e8e8e2;
  --surface: #f5f5f0;
  --line: #c8c9c2;
  --muted: #6e716c;
  --teal: #14d0d0;
  --teal-dark: #006a6a;
  --amber: #d9822b;
  --signal: #fff500;
  --red: #ff3b30;
  --blue: #3b7e8a;
  --shadow: 0 9px 25px rgba(16, 17, 16, 0.08);
  --radius: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
body { font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 246px; background: var(--ink); color: #eff8f7; padding: 24px 16px 18px; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 10px 28px; }
.brand-mark { width: 38px; height: 38px; border: 1px solid rgba(111, 235, 215, .8); background: linear-gradient(145deg, rgba(8,184,159,.35), rgba(8,184,159,.06)); display: grid; place-items: center; clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%); color: #77f1dd; font-family: "DM Mono", monospace; font-weight: 500; }
.brand strong { display: block; font-size: 15px; letter-spacing: .03em; }
.brand span { display: block; margin-top: 3px; color: #8ca3af; font-size: 11px; font-family: "DM Mono", monospace; letter-spacing: .12em; }
.side-label { color: #7590a0; font: 11px "DM Mono", monospace; letter-spacing: .13em; padding: 4px 12px 8px; }
.nav { display: grid; gap: 5px; }
.nav button { width: 100%; display: flex; align-items: center; gap: 11px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #b4c5cd; padding: 11px 12px; text-align: left; transition: .18s ease; }
.nav button:hover, .nav button.active { color: #effffb; background: rgba(255,255,255,.08); border-color: rgba(115, 224, 207, .2); }
.nav button.active { box-shadow: inset 3px 0 var(--teal); }
.nav-icon { width: 18px; color: #6ee3d0; font-size: 15px; text-align: center; }
.nav-text { font-size: 13px; }
.nav-count { margin-left: auto; color: #ffd18a; font: 11px "DM Mono", monospace; }
.sidebar-spacer { flex: 1; }
.side-status { padding: 14px; border: 1px solid rgba(117, 193, 182, .22); background: linear-gradient(135deg, rgba(8,184,159,.14), rgba(255,255,255,.02)); clip-path: polygon(0 0, 94% 0, 100% 15%, 100% 100%, 0 100%); }
.side-status small { color: #85a0ab; font-size: 11px; }
.side-status strong { display: block; margin-top: 5px; font: 16px "DM Mono", monospace; color: #83f1df; }
.side-status p { margin: 8px 0 0; color: #b3c7ce; font-size: 11px; line-height: 1.6; }

.main { min-width: 0; flex: 1; padding: 24px 28px 46px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; }
.eyebrow { color: var(--teal-dark); font: 11px "DM Mono", monospace; letter-spacing: .14em; text-transform: uppercase; }
.page-title { margin: 4px 0 0; font-size: 26px; letter-spacing: -.03em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.department-context { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: center; min-height: 38px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 5px 10px; text-align: left; }
.department-context small { grid-column: 1 / -1; color: var(--muted); font: 9px "DM Mono", monospace; letter-spacing: .1em; }
.department-context strong { font-size: 12px; }
.department-context span { grid-column: 2; grid-row: 2; color: var(--teal-dark); font: 10px "DM Mono", monospace; }
.department-context:hover { border-color: var(--teal-dark); background: #effcf9; }
.role-switch { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; color: var(--muted); font-size: 12px; }
.role-switch select { border: 0; background: transparent; color: var(--ink); font-weight: 700; outline: 0; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: #bff2e9; font-weight: 800; font-size: 12px; }
.mobile-toggle { display: none; }

.grid { display: grid; gap: 16px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card, .panel, .activity-card, .member-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 12px rgba(11,21,33,.025); }
.stat-card { padding: 18px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; width: 58px; height: 58px; position: absolute; right: -15px; bottom: -19px; border: 1px solid var(--line); transform: rotate(30deg); }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { margin: 9px 0 4px; font: 26px "DM Mono", monospace; letter-spacing: -.06em; }
.stat-note { color: var(--muted); font-size: 11px; }
.stat-card.teal .stat-value { color: var(--teal-dark); }
.stat-card.amber .stat-value { color: #c57e18; }
.stat-card.red .stat-value { color: var(--red); }
.section-grid { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr); margin-top: 16px; }
.panel { padding: 20px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-title { margin: 0; font-size: 16px; }
.panel-kicker { color: var(--muted); font: 10px "DM Mono", monospace; letter-spacing: .12em; }
.panel-action { border: 0; background: transparent; color: var(--teal-dark); font-size: 12px; padding: 0; }
.activity-list { display: grid; gap: 10px; }
.activity-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf1f2; }
.activity-row:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(8,184,159,.12); }
.activity-dot.pending { background: var(--amber); box-shadow: 0 0 0 4px rgba(244,170,69,.15); }
.activity-dot.closed { background: #9aa8ae; box-shadow: 0 0 0 4px rgba(154,168,174,.14); }
.activity-main strong { display: block; font-size: 13px; }
.activity-main span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.activity-meta { text-align: right; }
.activity-meta strong { display: block; font: 13px "DM Mono", monospace; }
.activity-meta span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-btn { min-height: 94px; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd; color: var(--ink); transition: .18s ease; }
.quick-btn:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-btn span { display: block; color: var(--teal-dark); font: 18px "DM Mono", monospace; }
.quick-btn strong { display: block; margin-top: 18px; font-size: 12px; }
.quick-btn small { color: var(--muted); font-size: 10px; }
.bar-chart { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 86px 1fr 38px; gap: 10px; align-items: center; font-size: 11px; }
.bar-track { height: 8px; border-radius: 999px; background: #e8eff0; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #6de0c9); }
.bar-value { font: 11px "DM Mono", monospace; text-align: right; color: var(--muted); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.toolbar-left, .toolbar-right { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.input, .select, .textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); color: var(--ink); outline: none; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,184,159,.1); }
.input { min-width: 210px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; font-size: 12px; font-weight: 700; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--ink); color: #f1fffc; }
.button.primary:hover { background: var(--ink-2); }
.button.teal { background: var(--teal); color: #06251f; }
.button.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.button.warning { background: #fff4df; color: #a26715; border-color: #f4d8a7; }
.button.danger { background: #fff0ef; color: #a84946; border-color: #f0c5c2; }
.button.small { padding: 7px 10px; font-size: 11px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 8px; font-size: 10px; white-space: nowrap; }
.chip.teal { background: #def7f1; color: #087d70; }
.chip.amber { background: #fff1d9; color: #9d6518; }
.chip.red { background: #ffebea; color: #a84946; }
.chip.gray { background: #eef2f3; color: #66777f; }
.chip.blue { background: #e7edff; color: #425fae; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid #edf1f2; font-size: 12px; }
th { color: var(--muted); font: 10px "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; background: #fbfcfc; }
tr:last-child td { border-bottom: 0; }
td strong { font-size: 12px; }
td small { display: block; color: var(--muted); margin-top: 3px; font-size: 10px; }
.score-positive { color: var(--teal-dark); font: 13px "DM Mono", monospace; }
.score-negative { color: var(--red); font: 13px "DM Mono", monospace; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.hero-panel { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; background: linear-gradient(135deg, #0b1521, #183547); color: white; border: 0; overflow: hidden; position: relative; }
.hero-panel::after { content: "M-OPS"; position: absolute; right: 20px; top: 13px; color: rgba(127,245,223,.2); font: 46px "DM Mono", monospace; letter-spacing: -.08em; }
.hero-panel .eyebrow { color: #69e2cb; }
.hero-panel h2 { margin: 8px 0; font-size: 25px; position: relative; z-index: 1; }
.hero-panel p { margin: 0; color: #a4bdc4; font-size: 12px; position: relative; z-index: 1; }
.hero-stat { position: relative; z-index: 1; text-align: right; }
.hero-stat strong { display: block; font: 33px "DM Mono", monospace; color: #81efd9; }
.hero-stat span { color: #a4bdc4; font-size: 11px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 11px; }
.textarea { min-height: 100px; resize: vertical; }
.form-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.member-select-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.member-toggle { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; font-size: 11px; }
.member-toggle input { accent-color: var(--teal); }
.member-toggle.selected { border-color: var(--teal); background: #effcf9; }

.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.detail-header h2 { margin: 0 0 7px; font-size: 23px; }
.detail-header p { margin: 0; color: var(--muted); font-size: 12px; }
.detail-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 18px; }
.mini-stat { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd; }
.mini-stat strong { display: block; font: 20px "DM Mono", monospace; }
.mini-stat span { color: var(--muted); font-size: 10px; }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 16px; }
.empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 12px; }
.empty strong { display: block; color: var(--ink); margin-bottom: 6px; }

.mobile-nav { display: none; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; background: var(--ink); color: #effffb; border: 1px solid rgba(110,227,208,.35); padding: 12px 15px; border-radius: 10px; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .22s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 18px; background: rgba(16,17,16,.62); }
.modal-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--ink); border-top: 5px solid var(--signal); padding: 20px; box-shadow: 0 18px 50px rgba(0,0,0,.24); }
.modal-backdrop { overflow-y: auto; align-items: start; }
.modal-card { margin-block: auto; max-height: calc(100dvh - 36px); overflow-y: auto; }
.t-entry-lock-note { margin: 0; padding: 10px 18px; font-size: 14px; color: #58634c; background: #e8ecdf; }
.office-setup { margin-block: 22px; padding: 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.office-setup h3 { margin: 0 0 10px; font-size: 20px; }
.office-setup p { margin: 0; max-width: 720px; font-size: 14px; line-height: 1.8; }
.office-setup > div:last-child { display: flex; flex-wrap: wrap; gap: 10px; }
.personal-scope-note { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px; padding:16px 20px; margin-bottom:20px; border:1px solid var(--line); background:var(--surface); }
.personal-scope-note strong { font-size:16px; }
.personal-scope-note p { margin:7px 0 0; font-size:14px; line-height:1.7; color:var(--muted); }
.personal-scope-note .t-button { min-height:44px; }
.modal-card h3 { margin: 7px 0; font-size: 19px; }
.modal-card p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.modal-kicker { color: var(--teal-dark); font: 10px "DM Mono", "Microsoft YaHei", sans-serif; letter-spacing: .12em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

@media (max-width: 980px) {
  .sidebar { width: 216px; }
  .main { padding: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .section-grid, .split { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .app-shell { display: block; padding-bottom: 70px; }
  .sidebar { display: none; }
  .main { padding: 18px 14px 30px; }
  .topbar { align-items: flex-start; margin-bottom: 19px; }
  .page-title { font-size: 22px; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .department-context { min-width: 142px; }
  .role-switch { font-size: 11px; }
  .avatar { display: none; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .hero-panel { grid-template-columns: 1fr; padding: 18px; }
  .hero-stat { text-align: left; }
  .hero-panel::after { font-size: 32px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .input { flex: 1; min-width: 0; width: 100%; }
  .form-grid, .member-select-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .detail-header { flex-direction: column; }
  .detail-actions { justify-content: flex-start; }
  .mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(4, 1fr); left: 0; right: 0; bottom: 0; z-index: 10; background: rgba(11,21,33,.97); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(110,227,208,.2); }
  .mobile-nav button { border: 0; background: transparent; color: #9bb0b8; padding: 7px 3px; font-size: 10px; }
  .mobile-nav button.active { color: #84efd9; }
  .mobile-nav span { display: block; font-size: 16px; margin-bottom: 3px; }
  .toast { right: 14px; bottom: 78px; left: 14px; text-align: center; }
  .modal-card { padding: 16px; }
  .modal-actions .button { flex: 1; }
}

