* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy:#0b1f3a; --blue:#0057ff; --blue2:#eaf1ff; --sky:#e9f3ff;
  --text:#1a2233; --muted:#6b7688; --line:#e3e8f0; --bg:#f4f7fb;
  --green:#0f9d58; --red:#d93025; --amber:#b26a00;
}
body { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; color:var(--text); background:var(--bg); font-size:14px; }
.hidden { display:none !important; }
.muted { color:var(--muted); line-height:1.8; }

.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(145deg,#0b1f3a,#123c6b); padding:20px; }
.login-card { width:100%; max-width:400px; background:#fff; border-radius:16px; padding:40px 36px; box-shadow:0 20px 60px rgba(0,0,0,.25); }
.login-logo { width:52px; height:52px; border-radius:14px; background:var(--blue); color:#fff; font-size:28px; font-weight:700; display:flex; align-items:center; justify-content:center; margin-bottom:20px; }
.login-card h1 { font-size:22px; margin-bottom:6px; }
.login-sub { color:var(--muted); margin-bottom:28px; }
.login-card label,.field label { display:block; font-weight:600; margin-bottom:8px; font-size:13px; }
.login-card input,.field input,.field select,.search-wrap input,.search-wrap select { width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:8px; font-size:14px; background:#fff; color:var(--text); outline:none; }
.login-card input:focus,.field input:focus,.field select:focus { border-color:var(--blue); box-shadow:0 0 0 3px var(--blue2); }
.login-card input { margin-bottom:16px; }
.login-hint { font-size:12px; color:var(--muted); margin-top:16px; text-align:center; line-height:1.6; }

.app { display:block; min-height:100vh; }
.navbar {
  position:sticky; top:0; z-index:40; background:#fff;
  border-bottom:1px solid var(--line); height:58px;
  display:flex; align-items:center; gap:26px; padding:0 30px;
}
.nav-brand { display:flex; align-items:center; gap:10px; white-space:nowrap; color:var(--text); font-weight:800; font-size:20px; }
.brand-mark { width:32px; height:32px; border-radius:8px; background:var(--blue); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:18px; }
.nav-links { display:flex; align-items:center; gap:4px; flex:1; min-width:0; overflow-x:auto; scrollbar-width:none; }
.nav-links::-webkit-scrollbar { display:none; }
.nav-item {
  padding:9px 15px; border-radius:6px; cursor:pointer; font-size:17px; font-weight:600;
  color:var(--muted); white-space:nowrap; flex-shrink:0;
}
.nav-item:hover { background:var(--bg); color:var(--blue); }
.nav-item.active { background:var(--blue2); color:var(--blue); font-weight:800; }
.nav-right { display:flex; align-items:center; gap:12px; margin-left:auto; position:relative; white-space:nowrap; }
.more-btn { width:32px; height:32px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--text); font-size:19px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.more-menu { position:absolute; top:100%; right:0; margin-top:8px; min-width:140px; background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:0 10px 28px rgba(0,0,0,.14); padding:6px; z-index:45; }
.more-menu button { display:block; width:100%; text-align:left; padding:10px 12px; border:none; background:none; border-radius:6px; font-size:14px; color:var(--text); cursor:pointer; }
.more-menu button:hover { background:var(--bg); }

.main { flex:1; min-width:0; }
.topbar { background:#fff; padding:22px 32px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; }
.topbar h2 { font-size:20px; }
.page-sub { color:var(--muted); font-size:13px; margin-top:4px; }
.user-label { font-weight:600; }
.badge { padding:4px 10px; border-radius:20px; font-size:12px; font-weight:600; }
.badge-amber { background:#fff4d6; color:var(--amber); }
.badge-green { background:#e3f5ea; color:var(--green); }
.badge-red { background:#fdecea; color:var(--red); }
.badge-gray { background:#eef1f5; color:var(--muted); }

.page { padding:28px 32px; max-width:1100px; }
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:22px; }
.stat-card { background:#fff; border:1px solid var(--line); border-radius:12px; padding:20px; }
.stat-label { color:var(--muted); font-size:13px; margin-bottom:10px; }
.stat-value { font-size:26px; font-weight:700; }
.panel { background:#fff; border:1px solid var(--line); border-radius:12px; padding:22px; margin-bottom:20px; }
.panel-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; gap:12px; }
.panel h3 { font-size:16px; margin-bottom:16px; }
.panel-head h3 { margin-bottom:0; }
.empty { color:var(--muted); text-align:center; padding:30px; }

.btn { padding:9px 16px; border:1px solid var(--line); background:#fff; border-radius:8px; cursor:pointer; font-size:14px; color:var(--text); }
.btn:hover { border-color:var(--blue); color:var(--blue); }
.btn-primary { background:var(--blue); border-color:var(--blue); color:#fff; }
.btn-primary:hover { background:#0046d1; color:#fff; }
.btn-sm { padding:6px 12px; font-size:13px; }
.btn-block { width:100%; padding:12px; }
.btn-danger { color:var(--red); }
.btn:disabled { opacity:.55; cursor:not-allowed; }

.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.field { margin-bottom:4px; }
.items-head { display:flex; align-items:center; justify-content:space-between; margin:22px 0 12px; }
.items-head h3 { margin:0; }
.item-row { display:grid; grid-template-columns:1fr 90px 120px 40px; gap:10px; margin-bottom:10px; align-items:center; }
.item-row input { padding:9px 10px; border:1px solid var(--line); border-radius:8px; width:100%; }
.item-del { border:none; background:#fdecea; color:var(--red); width:32px; height:32px; border-radius:8px; cursor:pointer; font-size:18px; }
.total-row { display:flex; justify-content:flex-end; align-items:center; gap:16px; padding:18px 0; border-top:1px solid var(--line); margin-top:8px; }
.total-row strong { font-size:20px; color:var(--blue); }
.actions { display:flex; gap:10px; }
.err { color:var(--red); font-size:13px; margin:10px 0; min-height:18px; }
.notice { background:#fff8e6; border:1px solid #ffe3a3; color:#7a5200; padding:12px 14px; border-radius:8px; margin-bottom:18px; line-height:1.6; font-size:13px; }

.search-wrap { display:flex; gap:10px; flex:1; }
.search-wrap input { max-width:360px; }
.search-wrap select { max-width:150px; }
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th,td { text-align:left; padding:11px 10px; border-bottom:1px solid var(--line); white-space:nowrap; }
th { color:var(--muted); font-weight:600; background:#fafbfd; }
tr:hover td { background:#fafcff; }
.cell-actions { display:flex; gap:8px; }

.account-card { border:1px solid var(--line); border-radius:10px; padding:16px; margin-bottom:12px; }
.account-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.account-head strong { font-size:15px; }
.account-meta { color:var(--muted); font-size:12px; line-height:1.9; }
.settings-row { display:flex; align-items:center; justify-content:space-between; border-top:1px solid var(--line); padding-top:18px; margin-top:18px; }
.settings-row label { display:flex; align-items:center; gap:8px; cursor:pointer; }

.modal-mask { position:fixed; inset:0; background:rgba(11,31,58,.45); display:flex; align-items:center; justify-content:center; z-index:50; padding:20px; }
.modal { background:#fff; border-radius:14px; width:100%; max-width:520px; max-height:90vh; overflow-y:auto; padding:24px; }
.modal-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.modal-head h3 { margin:0; }
.modal-close { border:none; background:none; font-size:24px; cursor:pointer; color:var(--muted); }
.modal-foot { display:flex; justify-content:flex-end; gap:10px; margin-top:20px; }
.modal .field { margin-bottom:14px; }

.toast { position:fixed; bottom:26px; left:50%; transform:translateX(-50%); background:var(--navy); color:#fff; padding:12px 22px; border-radius:8px; z-index:99; font-size:14px; }

/* 手机 / 窄屏：顶部横向导航，内容自适应 */
@media (max-width:900px) {
  .navbar { height:52px; padding:0 12px; gap:10px; }
  .brand-text { display:none; }
  .nav-links { gap:0; }
  .nav-item { padding:9px 11px; font-size:16px; font-weight:700; }
  .nav-right { gap:6px; }
  .user-label { display:none; }
  .badge { font-size:11px; padding:3px 8px; }
  .more-btn { width:30px; height:30px; font-size:18px; }
  .topbar { padding:15px 16px; }
  .topbar h2 { font-size:18px; }
  .page { padding:16px; }
  .stats-grid { grid-template-columns:repeat(2,1fr); gap:12px; }
  .stat-card { padding:16px; }
  .stat-value { font-size:22px; }
  .panel { padding:16px; }
  .panel-head { flex-wrap:wrap; }
  .grid-2 { grid-template-columns:1fr; gap:0; }
  .item-row { grid-template-columns:1fr 62px 82px 34px; gap:6px; }
  .item-del { width:32px; height:32px; }
  .search-wrap { flex-direction:column; width:100%; }
  .search-wrap input,.search-wrap select { max-width:none; }
  .settings-row { flex-direction:column; align-items:flex-start; gap:12px; }
  .actions { flex-wrap:wrap; }
  .modal { padding:18px; max-height:86vh; }
}

@media (max-width:380px) {
  .nav-item { padding:9px 9px; font-size:15px; font-weight:700; }
  .page { padding:12px; }
}

.share-modal { max-width:520px; }
.share-body { padding:6px 2px 4px; }
.share-tip { color:var(--muted); font-size:13px; margin-bottom:16px; }
.share-info { background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin-bottom:18px; }
.share-info > div { display:flex; justify-content:space-between; gap:12px; padding:5px 0; font-size:13px; }
.share-info > div + div { border-top:1px solid var(--line); }
.share-info span { color:var(--muted); flex-shrink:0; }
.share-info strong { text-align:right; word-break:break-all; font-weight:600; }
.share-label { display:block; font-weight:600; font-size:13px; margin-bottom:8px; }
.share-link-row { display:flex; gap:8px; }
.share-link-row input { flex:1; min-width:0; padding:11px 12px; border:1px solid var(--line); border-radius:8px; font-size:13px; color:var(--text); background:#fff; }
.share-link-row .btn { white-space:nowrap; }
.share-alt { font-size:12px; color:var(--muted); margin-top:10px; }
.share-alt a { color:var(--blue); }
.share-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:20px; }

@media (max-width:600px) {
  .share-link-row { flex-direction:column; }
  .share-actions { justify-content:stretch; }
  .share-actions .btn { flex:1; }
}
