:root {
  --ink: #172033;
  --ink-2: #3d4a63;
  --muted: #6b778c;
  --line: #e4e9f1;
  --line-2: #d6dde8;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --brand: #2f54eb;
  --brand-2: #597ef7;
  --brand-soft: #eef2ff;
  --side: #0f1b33;
  --teal: #0e9f8a;
  --amber: #d48806;
  --red: #d4380d;
  --green: #389e0d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  font-family: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { color: var(--ink); background: var(--bg); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }

/* ---------- 通用组件（各小程序页面共用） ---------- */
.page { padding: 28px 32px 40px; max-width: 1100px; margin: 0 auto; }
.page-title { margin: 0 0 20px; }
.page-title h1 { margin: 0; font-size: 22px; letter-spacing: .5px; }
.page-title p { margin: 6px 0 0; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 6px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.panel h2::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: linear-gradient(var(--brand), var(--brand-2)); }
.panel > p { color: var(--muted); line-height: 1.7; margin: 6px 0 14px; }
.panel ol { margin: 0 0 16px; padding-left: 20px; line-height: 1.9; color: var(--ink-2); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.button, button { min-height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.button:hover, button:hover { border-color: var(--brand-2); color: var(--brand); }
.button:active, button:active { transform: translateY(1px); }
.button.primary, button.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 14px rgba(47, 84, 235, .25); }
.button.primary:hover, button.primary:hover { color: #fff; filter: brightness(1.05); }
.button.danger, button.danger { color: var(--red); }
button:disabled { opacity: .55; cursor: wait; }
a.button { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
a.button.primary { color: #fff; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea { min-height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { padding: 10px 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(89, 126, 247, .15); }
input[type=file] { font-size: 13px; color: var(--muted); }
input[type=file]::file-selector-button { min-height: 34px; padding: 0 12px; margin-right: 10px; border-radius: 9px; border: 1px solid var(--line-2); background: #f7f9fc; font-weight: 600; cursor: pointer; }
.msg { min-height: 20px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.msg.error { color: var(--red); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: #f8fafd; padding: 10px; border-bottom: 1px solid var(--line); }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f0f2f5; color: var(--ink-2); }
.badge[data-s="待查看"] { background: #fff7e6; color: var(--amber); }
.badge[data-s="处理中"] { background: #e6fffb; color: var(--teal); }
.badge[data-s="已完成"] { background: #f6ffed; color: var(--green); }

.meta { color: var(--muted); font-size: 13px; }
.perm-box { display: grid; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #f8fafd; border: 1px solid var(--line); }
.perm-options { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.perm-options label { display: inline-flex; gap: 6px; align-items: center; }
.perm-box button { justify-self: start; }

/* ---------- 外壳 ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; height: 100vh; }
.side { background: radial-gradient(120% 60% at 0 0, #1d3466 0, var(--side) 60%); color: #fff; display: flex; flex-direction: column; padding: 18px 14px; gap: 4px; overflow: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #597ef7, #36cfc9); box-shadow: 0 8px 20px rgba(54, 207, 201, .25); flex: none; }
.brand-mark svg { width: 22px; height: 22px; }
.brand b { display: block; font-size: 16px; letter-spacing: 1px; }
.brand small { display: block; font-size: 11px; color: #9fb0d4; margin-top: 2px; }
.nav-label { font-size: 11px; color: #7f91b8; letter-spacing: 1px; padding: 14px 10px 6px; }
.nav { position: relative; display: flex; gap: 12px; align-items: center; width: 100%; min-height: 0; padding: 9px 10px; border: 0; border-radius: 12px; background: transparent; color: #c9d4ee; text-align: left; cursor: pointer; box-shadow: none; }
.nav:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav.active { background: rgba(89, 126, 247, .2); color: #fff; }
.nav.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: #597ef7; }
.nav .icon { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .07); box-shadow: 0 4px 10px rgba(0, 0, 0, .18); }
.nav.active .icon { outline: 2px solid rgba(255, 255, 255, .85); outline-offset: 2px; }
/* 每个小程序固定一个颜色的图标底，侧边栏和首页卡片一致。新小程序没配颜色时用默认蓝色。 */
.icon[class*="ic-"] { background: linear-gradient(135deg, #2f54eb, #597ef7); }
.ic-home { background: linear-gradient(135deg, #597ef7, #36cfc9) !important; }
.ic-price { background: linear-gradient(135deg, #fa8c16, #ffc53d) !important; }
.ic-inventory { background: linear-gradient(135deg, #08979c, #36cfc9) !important; }
.ic-layout { background: linear-gradient(135deg, #722ed1, #b37feb) !important; }
.ic-orders { background: linear-gradient(135deg, #1d39c4, #597ef7) !important; }
.ic-requests { background: linear-gradient(135deg, #eb2f96, #ff85c0) !important; }
.ic-accounts { background: linear-gradient(135deg, #389e0d, #73d13d) !important; }
.ic-purchase { background: linear-gradient(135deg, #d4380d, #ff7a45) !important; }
.ic-amazon { background: linear-gradient(135deg, #232f3e, #ff9900) !important; }
.ic-kr { background: linear-gradient(135deg, #cd2e3a, #0047a0) !important; }
.ic-ztc { background: linear-gradient(135deg, #ff5000, #ff9a3c) !important; }
.ic-me { background: linear-gradient(135deg, #595959, #8c8c8c) !important; }
.nav .icon svg { width: 19px; height: 19px; }
.nav b { display: block; font-size: 14px; font-weight: 600; }
.nav small { display: block; font-size: 11px; color: #8fa1c7; margin-top: 2px; line-height: 1.35; }
.nav.active small { color: #c9d4ee; }
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ff4d4f; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; margin-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: linear-gradient(135deg, #ffa940, #ff7a45); color: #fff; flex: none; }
.who-name { flex: 1; min-width: 0; }
.who-name b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-name small { font-size: 11px; color: #8fa1c7; }
.who button { min-height: 32px; padding: 0 10px; border-radius: 8px; background: transparent; border: 1px solid rgba(255, 255, 255, .15); color: #c9d4ee; font-size: 12px; box-shadow: none; }
.who button:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .25); }
main { position: relative; min-width: 0; overflow: auto; background: var(--bg); }
main iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--bg); }

/* ---------- 首页 ---------- */
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 28px 30px; color: #fff; background: linear-gradient(120deg, #2f54eb 0%, #597ef7 55%, #36cfc9 120%); box-shadow: var(--shadow-lg); margin-bottom: 22px; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero::before { content: ""; position: absolute; right: 140px; bottom: -130px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero h1 { position: relative; margin: 0; font-size: 26px; letter-spacing: .5px; }
.hero p { position: relative; margin: 8px 0 0; color: rgba(255, 255, 255, .88); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); cursor: default; }
.stat small { color: var(--muted); }
.stat b { display: block; font-size: 26px; margin-top: 6px; }
.section-title { font-size: 15px; font-weight: 700; margin: 4px 0 12px; color: var(--ink-2); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 26px; }
.card { text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; min-height: 0; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #c7d3ff; color: inherit; }
.card .icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; }
.card .icon svg { width: 24px; height: 24px; }
.card b { font-size: 16px; }
.card small { color: var(--muted); line-height: 1.6; font-weight: 400; }
.card .go { margin-top: auto; font-size: 13px; color: var(--brand); font-weight: 600; }
.tone-0 { background: linear-gradient(135deg, #2f54eb, #597ef7); }
.tone-1 { background: linear-gradient(135deg, #08979c, #36cfc9); }
.tone-2 { background: linear-gradient(135deg, #fa8c16, #ffc069); }
.tone-3 { background: linear-gradient(135deg, #722ed1, #9254de); }
.tone-4 { background: linear-gradient(135deg, #eb2f96, #ff85c0); }
.tone-5 { background: linear-gradient(135deg, #389e0d, #95de64); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: #fafbff; }
.list-item b { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item small { color: var(--muted); white-space: nowrap; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

/* ---------- 登录页 ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(120% 80% at 0 0, #2f54eb 0, #1d39c4 40%, #0f1b33 100%); }
.login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(54, 207, 201, .45), transparent 65%); }
.login-art .brand { padding: 0; position: relative; }
.login-art h2 { font-size: 34px; margin: 0; line-height: 1.35; position: relative; }
.login-art p { color: rgba(255, 255, 255, .8); line-height: 1.8; max-width: 440px; position: relative; }
.login-art ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; position: relative; }
.login-art li { display: flex; gap: 10px; align-items: center; color: rgba(255, 255, 255, .92); }
.login-art li::before { content: "✓"; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: rgba(255, 255, 255, .18); }
.login-art footer { position: relative; font-size: 12px; color: rgba(255, 255, 255, .55); }
.login-form { display: grid; place-items: center; padding: 24px; }
.login form { width: min(380px, 100%); display: grid; gap: 16px; }
.login h1 { margin: 0; font-size: 26px; }
.login .sub { margin: -8px 0 6px; color: var(--muted); }
.login label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.login input { min-height: 46px !important; }
.login button { min-height: 46px; font-size: 15px; }

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; align-items: center; padding: 8px; gap: 6px; overflow-x: auto; }
  .side > .brand, .nav-label, .side .spacer, .nav small, .who-name { display: none; }
  .nav { width: auto; padding: 6px; }
  .nav.active::before { display: none; }
  .who { border: 0; margin: 0; padding: 0 4px; }
  .page { padding: 18px 16px 32px; }
}
.pw { font: 600 14px ui-monospace, Menlo, monospace; background: #f5f7fb; padding: 3px 10px; border-radius: 8px; letter-spacing: .5px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c0c6d2; margin-right: 6px; vertical-align: middle; } .dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(56,158,13,.18); }
