* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #333; background: #F3F4F6; }
.hidden { display: none !important; }
a { color: #C98A00; cursor: pointer; text-decoration: none; }
.muted { color: #999; font-size: 12px; }
.btn { display: inline-block; padding: 6px 14px; border: 1px solid #DDD; border-radius: 6px; background: #FFF; color: #333; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: #FFB700; color: #B07D00; }
.btn.primary { background: linear-gradient(90deg, #FFB700, #FFB62D); border-color: #FFB700; color: #FFF; }
.btn.danger { color: #E5484D; border-color: #F3C2C3; }
.btn.small { padding: 3px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input, select, textarea { width: 100%; padding: 7px 10px; border: 1px solid #DDD; border-radius: 6px; font: inherit; background: #FFF; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #FFB700; box-shadow: 0 0 0 2px rgba(255,183,0,.15); }
input[type=checkbox] { width: auto; }
textarea { min-height: 80px; resize: vertical; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #4D2B13, #3A2513); }
.login-box { width: 360px; padding: 32px; border-radius: 12px; background: #FFF5C0; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.login-box h1 { margin: 0 0 20px; font-size: 20px; text-align: center; color: #4D2B13; }
.login-box label { display: block; margin-bottom: 14px; color: #656565; }
.login-box .btn { width: 100%; padding: 10px; font-size: 15px; }
.login-box .force-tip { margin: -8px 0 16px; padding: 8px 10px; border-radius: 6px; background: #FFE7A8; color: #8A4B00; }
.login-box .force-out { margin: 12px 0 0; text-align: center; }
.layout { display: flex; min-height: 100vh; }
.side { width: 200px; flex-shrink: 0; background: #3A2513; color: #F1DDBF; }
.brand { padding: 18px 20px; font-size: 18px; font-weight: bold; color: #FFE357; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand small { display: block; font-size: 12px; font-weight: normal; color: #C9B08A; }
.side nav .grp { padding: 12px 20px 4px; font-size: 12px; color: #8F6029; }
.side nav a { display: block; padding: 8px 20px 8px 28px; color: #F1DDBF; }
.side nav a:hover { background: rgba(255,255,255,.05); }
.side nav a.on { background: #8F6029; color: #FFF; }
.content { flex: 1; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; height: 54px; padding: 0 20px; background: #FFF; border-bottom: 1px solid #EEE; }
.top-right { display: flex; align-items: center; gap: 10px; }
.crumb { font-size: 16px; font-weight: bold; }
.view { padding: 20px; }
.card { background: #FFF; border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #FFF; border-radius: 10px; padding: 14px 16px; border-left: 4px solid #FFB700; }
.stat b { display: block; font-size: 24px; color: #333; }
.stat span { color: #999; font-size: 12px; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 160px; padding-top: 10px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 12px; color: #999; }
.bars .pair { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bars i { display: block; width: 14px; background: #FFB700; border-radius: 3px 3px 0 0; }
.bars i.u { background: #08C765; }
.legend i { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 12px; background: #FFB700; }
.legend i.u { background: #08C765; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: 180px; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #FFF; }
th, td { padding: 8px 10px; border-bottom: 1px solid #F0F0F0; text-align: left; vertical-align: middle; white-space: nowrap; }
td.wrap { white-space: normal; max-width: 320px; }
th { background: #FAFAFA; color: #656565; font-weight: normal; }
tr:hover td { background: #FFFBEA; }
td img.thumb { height: 36px; max-width: 90px; border-radius: 4px; object-fit: cover; background: #EEE; }
.tag { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; background: #EEE; color: #666; }
.tag.ok { background: #E6F9EE; color: #08A757; }
.tag.warn { background: #FFF5C0; color: #B07D00; }
.tag.bad { background: #FDECEC; color: #E5484D; }
.ops { display: flex; gap: 6px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 12px; }
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 40px 10px; background: rgba(0,0,0,.4); overflow-y: auto; }
.modal-box { width: 640px; max-width: 100%; background: #FFF; border-radius: 10px; }
.modal-head { display: flex; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #EEE; font-size: 16px; font-weight: bold; }
.modal-head .x { color: #999; font-size: 22px; line-height: 1; }
.modal-body { padding: 16px 18px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid #EEE; text-align: right; }
.modal-foot .btn { margin-left: 8px; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-row > label { width: 120px; flex-shrink: 0; padding-top: 7px; text-align: right; color: #656565; }
.form-row > div { flex: 1; min-width: 0; }
.form-row .hint { color: #999; font-size: 12px; }
.img-field { display: flex; gap: 8px; align-items: center; }
.img-field img { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: #EEE; flex-shrink: 0; }
.img-field input[type=file] { display: none; }
.kv td input, .kv td textarea { min-width: 260px; }
.toast { position: fixed; left: 50%; top: 20px; z-index: 99; transform: translateX(-50%); padding: 8px 18px; border-radius: 6px; background: rgba(0,0,0,.78); color: #FFF; }
.toast.err { background: #E5484D; }
.img-field .btn { white-space: nowrap; flex-shrink: 0; }
.img-field input:not([type=file]) { flex: 1; min-width: 0; }
