* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif; background: #f5f0e8; color: #2b2118; }
.topbar { background: #2b2118; color: #fdf9f2; display: flex; align-items: center; padding: 12px 20px; gap: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { background: #6b4423; color: #fff; font-weight: 700; padding: 4px 8px; border-radius: 6px; font-size: 14px; }
.title { font-weight: 600; font-size: 16px; }
.env-badge { background: #6b4423; color: #fdf9f2; font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.nav { display: flex; gap: 18px; flex: 1; }
.nav a { color: #fdf9f2; text-decoration: none; font-size: 14px; opacity: 0.75; }
.nav a.active { opacity: 1; font-weight: 600; border-bottom: 2px solid #fdf9f2; }
.user { font-size: 13px; opacity: 0.85; }
.main { max-width: 960px; margin: 24px auto; padding: 0 20px; }
.loading { text-align: center; padding: 40px; color: #7a6a55; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select, .toolbar button { padding: 6px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; background: #fff; }
.toolbar button { background: #6b4423; color: #fff; border: none; cursor: pointer; }
.toolbar button:hover { background: #8a5a35; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0e8d8; font-size: 14px; }
th { background: #f8f7f4; font-weight: 600; color: #6b4423; }
tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.badge.ok { background: #d4e6d4; color: #2d6a2d; }
.badge.off { background: #f0d4d4; color: #8a3a3a; }
.badge.warn { background: #f5e6c8; color: #8a5a35; }
.btn { padding: 6px 12px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn.primary { background: #6b4423; color: #fff; }
.btn.ghost { background: transparent; color: #6b4423; border: 1px solid #d4c8b0; }
.btn.danger { background: #c44848; color: #fff; }
.btn:hover { opacity: 0.85; }
code { font-family: ui-monospace, "Cascadia Code", monospace; font-size: 13px; background: #f0e8d8; padding: 1px 6px; border-radius: 4px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 12px; padding: 24px; max-width: 520px; width: 90%; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.modal h2 { margin: 0 0 12px; color: #6b4423; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: #7a6a55; margin-bottom: 4px; }
.field input, .field select { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.actions-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.plaintext-box { background: #f8f7f4; border: 2px solid #6b4423; border-radius: 8px; padding: 16px; font-family: ui-monospace, monospace; font-size: 15px; word-break: break-all; margin: 12px 0; }
.warn-text { color: #c44848; font-size: 13px; margin-bottom: 8px; }
.error-banner { background: #f0d4d4; color: #8a3a3a; padding: 12px 16px; border-radius: 8px; margin-bottom: 12px; }
.metric-card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.metric-card .label { font-size: 12px; color: #7a6a55; }
.metric-card .value { font-size: 24px; font-weight: 700; color: #6b4423; margin-top: 4px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.footer { text-align: center; padding: 16px; color: #7a6a55; font-size: 12px; }
.footer a { color: #6b4423; margin-left: 12px; }
