:root {
  --bg: #f5f7fa; --card: #ffffff; --line: #e5e9f0;
  --text: #1f2937; --muted: #6b7280; --brand: #2563eb; --brand-dark: #1e46c8;
  --green: #16a34a; --red: #dc2626; --amber: #d97706;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--brand); text-decoration: none; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 50; }
.topbar .logo { font-weight: 700; font-size: 17px; color: var(--brand); }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.topbar nav a:hover, .topbar nav a.active { background: #eef2ff; color: var(--brand); }
.topbar .user-area { display: flex; align-items: center; gap: 10px; }
.balance-chip { background: #ecfdf5; color: var(--green); border-radius: 20px; padding: 4px 12px; font-weight: 600; }
.container { max-width: 1080px; margin: 0 auto; padding: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
h2.section { font-size: 16px; margin: 18px 0 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer; }
.btn:hover { background: var(--brand-dark); }
.btn.gray { background: #eef0f4; color: var(--text); }
.btn.gray:hover { background: #dfe3ea; }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; width: 100%; background: #fff; }
input:focus, select:focus { outline: 2px solid #bfdbfe; border-color: var(--brand); }
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; background: #eef2ff; color: var(--brand); }
.tag.green { background: #ecfdf5; color: var(--green); }
.tag.red { background: #fef2f2; color: var(--red); }
.tag.amber { background: #fffbeb; color: var(--amber); }
.tag.gray { background: #f3f4f6; color: var(--muted); }
.grid-regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.region-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: box-shadow .15s; position: relative; }
.region-card:hover { box-shadow: 0 4px 14px rgba(37,99,235,.12); border-color: #c7d7fe; }
.region-card .flag { font-size: 20px; }
.region-card .name { font-weight: 600; margin: 6px 0 2px; }
.region-card .prov { color: var(--muted); font-size: 12px; }
.region-card .price { color: var(--brand); font-weight: 700; font-size: 16px; margin-top: 8px; }
.region-card .price small { font-weight: 400; color: var(--muted); }
.region-card .stock { position: absolute; top: 12px; right: 12px; font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 6px 14px; cursor: pointer; font-size: 13px; color: var(--muted); }
.tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: min(440px, 92vw); max-height: 86vh; overflow: auto; }
.modal h3 { margin-bottom: 14px; }
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 200; max-width: 80vw; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; }
.stat .k { color: var(--muted); font-size: 12px; }
.cred-box { background: #f8fafc; border: 1px dashed var(--line); border-radius: 8px; padding: 10px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 12px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
