* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --primary:#c8342b; --primary-d:#a52822; --bg:#f0f2f5; --side:#232733; --line:#e8e8e8; --muted:#8a8f99; --ok:#2e9e5b; }
html,body { background:var(--bg); color:#333; font-family:-apple-system,"Microsoft YaHei",sans-serif; font-size:14px; }
#app { min-height:100vh; }
button { font-family:inherit; cursor:pointer; }
input,select,textarea { font-family:inherit; font-size:14px; border:1px solid #d9d9d9; border-radius:6px; padding:8px 10px; outline:none; width:100%; }
input:focus,select:focus,textarea:focus { border-color:var(--primary); }

/* 登录 */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#c8342b,#7a1d18); }
.login-box { background:#fff; border-radius:12px; padding:36px; width:360px; box-shadow:0 10px 40px rgba(0,0,0,.2); }
.login-box h1 { font-size:20px; text-align:center; margin-bottom:6px; }
.login-box p { text-align:center; color:var(--muted); margin-bottom:24px; font-size:13px; }
.login-box .field { margin-bottom:16px; }

/* 布局 */
.layout { display:flex; min-height:100vh; }
.sidebar { width:210px; background:var(--side); color:#cfd3dc; flex-shrink:0; display:flex; flex-direction:column; }
.sidebar .logo { padding:20px 18px; font-size:16px; font-weight:600; color:#fff; border-bottom:1px solid rgba(255,255,255,.08); }
.nav a { display:block; padding:12px 18px; color:#cfd3dc; text-decoration:none; cursor:pointer; font-size:14px; border-left:3px solid transparent; }
.nav a:hover { background:rgba(255,255,255,.05); color:#fff; }
.nav a.active { background:rgba(200,52,43,.18); color:#fff; border-left-color:var(--primary); }
.main { flex:1; display:flex; flex-direction:column; min-width:0; }
.header { background:#fff; padding:14px 24px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); }
.header .title { font-size:17px; font-weight:600; }
.content { padding:20px 24px; flex:1; }

/* 通用 */
.card { background:#fff; border-radius:8px; padding:18px; box-shadow:0 1px 3px rgba(0,0,0,.04); margin-bottom:16px; }
.btn { background:var(--primary); color:#fff; border:none; border-radius:6px; padding:8px 16px; font-size:14px; }
.btn:hover { background:var(--primary-d); }
.btn:disabled { background:#ccc; }
.btn-plain { background:#fff; color:#333; border:1px solid #d9d9d9; }
.btn-plain:hover { border-color:var(--primary); color:var(--primary); background:#fff; }
.btn-sm { padding:4px 10px; font-size:13px; }
.btn-danger { background:#fff; color:var(--primary); border:1px solid var(--primary); }
.btn-danger:hover { background:var(--primary); color:#fff; }
.toolbar { display:flex; gap:10px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }
.toolbar input, .toolbar select { width:auto; min-width:180px; }
.spacer { flex:1; }

table { width:100%; border-collapse:collapse; background:#fff; }
th,td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); font-size:13px; vertical-align:middle; }
th { background:#fafafa; color:#666; font-weight:600; white-space:nowrap; }
td .actions { display:flex; gap:6px; flex-wrap:wrap; }
tr:hover td { background:#fafbfc; }

.stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:20px; }
.stat { background:#fff; border-radius:8px; padding:20px; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.stat .num { font-size:30px; font-weight:700; color:var(--primary); }
.stat .lbl { color:var(--muted); margin-top:6px; }

.tag { display:inline-block; padding:2px 8px; border-radius:10px; font-size:12px; }
.st-submitted,.st-pending{background:#fff3e0;color:#e08600;}
.st-shipped{background:#e3f0ff;color:#2b7de0;}
.st-completed{background:#eaf6ee;color:var(--ok);}
.st-returned{background:#fdeceb;color:var(--primary);}
.st-cancelled{background:#f0f0f0;color:#888;}
.tag.on{background:#eaf6ee;color:var(--ok);} .tag.off{background:#f0f0f0;color:#888;}
.tag.draft{background:#f0f0f0;color:#888;} .tag.ongoing{background:#eaf6ee;color:var(--ok);} .tag.ended{background:#fdeceb;color:var(--primary);}

.field { margin-bottom:14px; }
.field label { display:block; margin-bottom:6px; color:#555; font-size:13px; }
.row { display:flex; gap:12px; }
.row .field { flex:1; }
.muted { color:var(--muted); }

/* 弹窗 */
.mask { position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; z-index:100; }
.modal { background:#fff; border-radius:10px; width:520px; max-width:92vw; max-height:88vh; overflow:auto; }
.modal .m-head { padding:16px 20px; border-bottom:1px solid var(--line); font-weight:600; display:flex; justify-content:space-between; }
.modal .m-body { padding:20px; }
.modal .m-foot { padding:14px 20px; border-top:1px solid var(--line); display:flex; justify-content:flex-end; gap:10px; }
.close { cursor:pointer; color:#999; }

.qrbox { text-align:center; }
.qrbox img { width:240px; height:240px; }
.link-box { display:flex; gap:8px; margin-top:12px; }
.link-box input { flex:1; }

.toast { position:fixed; top:20px; left:50%; transform:translateX(-50%); background:#333; color:#fff; padding:10px 20px; border-radius:6px; z-index:200; font-size:14px; }
.toast.err { background:var(--primary); }
.empty { text-align:center; color:var(--muted); padding:50px 0; }
.gimg { width:44px; height:44px; border-radius:6px; object-fit:cover; background:#eee; }
.reports a { display:block; }
.report-item { display:flex; align-items:center; justify-content:space-between; padding:14px 0; border-bottom:1px solid var(--line); }
.report-item:last-child { border-bottom:none; }
.report-item .d { color:var(--muted); font-size:13px; margin-top:2px; }
.hint { background:#f6f8ff; border:1px solid #d6e0ff; color:#3a5; padding:10px 12px; border-radius:6px; font-size:13px; margin-bottom:12px; color:#456; }
.perm-list { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.perm-item { display:flex; align-items:center; gap:6px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; cursor:pointer; font-size:13px; }
.perm-item input { width:auto; }
button:disabled { opacity:.5; cursor:not-allowed; }
