* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #1f2329; background: #f5f6f8; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: #fff; border-bottom: 1px solid #e5e6eb; }
.brand { font-weight: 600; font-size: 16px; }
nav { display: flex; gap: 4px; flex: 1; }
nav button { border: 0; background: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font: inherit; color: #4e5969; }
nav button.on { background: #e8f3ff; color: #165dff; font-weight: 600; }
main { max-width: 1200px; margin: 0 auto; padding: 20px 24px 60px; }
h2 { font-size: 18px; margin: 8px 0 12px; } h3 { font-size: 15px; margin: 20px 0 8px; }
.muted { color: #86909c; } .small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.between { justify-content: space-between; }
.filters input { width: 260px; } .wide { width: 520px !important; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid #c9cdd4; border-radius: 6px; background: #fff; }
textarea { width: 100%; min-height: 70px; resize: vertical; }
button, .btn { font: inherit; padding: 6px 14px; border: 1px solid #c9cdd4; border-radius: 6px; background: #fff; cursor: pointer; color: #1f2329; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: #165dff; color: #165dff; }
button.primary { background: #165dff; border-color: #165dff; color: #fff; }
button.danger { color: #f53f3f; border-color: #fbaca3; }
button:disabled { opacity: .5; cursor: default; }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: #f53f3f; color: #fff; font-size: 12px; line-height: 18px; }
.badge:empty { display: none; }
.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.card { background: #fff; border: 1px solid #e5e6eb; border-radius: 8px; padding: 14px 16px; }
.card .v { font-size: 24px; font-weight: 600; } .card .k { color: #86909c; font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e6eb; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f0f1f3; vertical-align: top; }
th { background: #f7f8fa; font-weight: 600; color: #4e5969; font-size: 12px; }
table.clickable tbody tr { cursor: pointer; } table.clickable tbody tr:hover { background: #f7f8fa; }
td.clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; background: #f2f3f5; color: #4e5969; white-space: nowrap; }
.tag.blue { background: #e8f3ff; color: #165dff; } .tag.green { background: #e8ffea; color: #00b42a; }
.tag.red { background: #ffece8; color: #f53f3f; } .tag.orange { background: #fff7e8; color: #d25f00; }
.seg { display: inline-flex; border: 1px solid #c9cdd4; border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; border-right: 1px solid #e5e6eb; }
.seg button:last-child { border-right: 0; } .seg button.on { background: #e8f3ff; color: #165dff; }
.kitem { background: #fff; border: 1px solid #e5e6eb; border-radius: 8px; padding: 12px 14px; margin: 10px 0; }
.kitem .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kitem .kid { font-family: ui-monospace, Consolas, monospace; color: #86909c; font-size: 12px; }
.kitem label { display: block; font-size: 12px; color: #86909c; margin-top: 8px; }
.kitem .grid3 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kitem .grid3 input, .kitem .grid3 select { width: 100%; }
.note { background: #fff7e8; color: #a34d00; padding: 6px 10px; border-radius: 6px; font-size: 12px; margin-top: 8px; }
#drawer .drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 10; }
#drawer .drawer-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(860px, 92vw); background: #fff; z-index: 11; padding: 16px 24px; overflow: auto; }
pre { white-space: pre-wrap; word-break: break-word; background: #f7f8fa; border: 1px solid #e5e6eb; border-radius: 6px; padding: 10px; font-size: 12px; max-height: 420px; overflow: auto; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; }
.kv div:nth-child(odd) { color: #86909c; }
.diff del { background: #ffece8; text-decoration: line-through; } .diff ins { background: #e8ffea; text-decoration: none; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.imgs figure { margin: 0; background: #fff; border: 1px solid #e5e6eb; border-radius: 8px; padding: 8px; }
.imgs img { width: 100%; height: 140px; object-fit: contain; background: #f7f8fa; }
.imgs figcaption { font-size: 12px; word-break: break-all; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1f2329; color: #fff; padding: 8px 16px; border-radius: 6px; z-index: 20; }
.empty { text-align: center; color: #86909c; padding: 30px; background: #fff; border: 1px dashed #e5e6eb; border-radius: 8px; }
td.sku { max-width: 200px; word-break: break-word; }
.kitem .scope { font-size: 12px; color: #165dff; background: #e8f3ff; border-radius: 4px; padding: 3px 8px; margin: 4px 0; display: inline-block; }
td.tok { white-space: nowrap; text-align: right; }
#pr-text { width: 100%; min-height: 360px; font-size: 13px; line-height: 1.6; font-family: inherit; }
#pr-preview pre { max-height: 420px; overflow: auto; }
body.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; }
.login-box { background: #fff; border: 1px solid #e5e6eb; border-radius: 10px; padding: 28px 32px; width: 340px; display: flex; flex-direction: column; gap: 10px; }
.login-box h2 { margin: 0 0 6px; font-size: 18px; }
.login-box input { padding: 8px 10px; }
.err { color: #f53f3f; } .ok { color: #00b42a; }
#tab-settings .form { max-width: 760px; }
#tab-settings label { display: block; font-weight: 600; margin: 14px 0 4px; }
#tab-settings label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; }
#tab-settings input[type=text], #tab-settings input[type=password], #tab-settings input[type=number], #tab-settings textarea, #tab-settings select { width: 100%; box-sizing: border-box; }
#tab-settings h3 { margin-top: 28px; border-top: 1px solid #e5e6eb; padding-top: 18px; }
.token-box { background: #fff7e8; border: 1px solid #ffcf8b; border-radius: 6px; padding: 10px 12px; margin: 10px 0; word-break: break-all; }
