* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f6f5f1; color: #3a2e28; font-size: 14px; }
a { color: #ff7a2f; text-decoration: none; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #ffd9a8, #ffb84d); }
.login-card { background: #fff; border-radius: 16px; padding: 40px 36px; width: 340px; box-shadow: 0 18px 50px rgba(0,0,0,.18); text-align: center; }
.login-card .logo { font-size: 52px; }
.login-card h1 { font-size: 20px; margin: 10px 0 22px; }
.login-card input { display: block; width: 100%; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #e6ddd2; border-radius: 10px; font-size: 14px; }
.err { color: #f76b56; font-size: 13px; margin-top: 8px; min-height: 18px; }

/* 布局 */
#view-main { display: flex; min-height: 100vh; }
.side { width: 220px; background: #fff8ef; border-right: 1px solid #efe4d5; padding: 22px 14px; display: flex; flex-direction: column; }
.brand { font-weight: 800; font-size: 17px; padding: 4px 10px 18px; }
.side nav a { display: block; padding: 12px 14px; border-radius: 10px; color: #6b5a48; margin-bottom: 4px; cursor: pointer; }
.side nav a.active { background: #ffe6cf; color: #f05a1e; font-weight: 700; }
.side-user { margin-top: auto; padding: 12px 10px; border-top: 1px solid #efe4d5; font-size: 13px; color: #8c7b6c; display: flex; justify-content: space-between; align-items: center; }
.main { flex: 1; padding: 26px 30px; }
.main h2 { margin-bottom: 18px; font-size: 20px; }

/* 统计 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.stat-card { background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 6px 18px rgba(0,0,0,.04); }
.stat-card .n { font-size: 30px; font-weight: 800; color: #ff7a2f; }
.stat-card .l { color: #8c7b6c; margin-top: 4px; }

/* 表格与工具栏 */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input { padding: 10px 12px; border: 1px solid #e6ddd2; border-radius: 10px; font-size: 14px; width: 220px; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.04); }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid #f3ece1; font-size: 13px; }
.tbl th { background: #fffaf3; color: #8c7b6c; font-weight: 600; }
.btn { border: none; border-radius: 10px; padding: 10px 18px; cursor: pointer; font-size: 14px; }
.btn.primary { background: #ff7a2f; color: #fff; }
.btn.danger { background: #fdeae7; color: #f76b56; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.pager { margin-top: 14px; display: flex; gap: 8px; align-items: center; }
.pager button { border: 1px solid #e6ddd2; background: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; }

/* 抽屉 */
#drawer-mask { position: fixed; inset: 0; background: rgba(58,46,40,.45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 92vw; background: #fff; z-index: 50; overflow-y: auto; box-shadow: -12px 0 40px rgba(0,0,0,.18); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid #f3ece1; position: sticky; top: 0; background: #fff; }
.drawer-head a { font-size: 24px; color: #8c7b6c; }
.drawer-body { padding: 20px 22px 40px; }
.child-box { border: 1px solid #f3ece1; border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.child-box h4 { margin-bottom: 6px; }
.kv { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: #8c7b6c; margin-top: 6px; }
.tag { display: inline-block; background: #fff1e2; color: #f05a1e; border-radius: 999px; padding: 2px 10px; font-size: 12px; margin-left: 6px; }
.empty { color: #c9b8a5; text-align: center; padding: 40px 0; }
.form-field { margin: 10px 0; }
.form-field label { display: block; font-size: 12px; color: #8c7b6c; margin-bottom: 4px; }
.form-field input, .form-field textarea, #cf-json {
  width: 100%; box-sizing: border-box; padding: 8px 10px;
  border: 1px solid #e6ddd2; border-radius: 8px; font-size: 13px; font-family: inherit;
}
.form-actions { margin-top: 14px; display: flex; justify-content: flex-end; gap: 8px; }
.mini-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.mini-table td { border-bottom: 1px solid #f7f1e6; padding: 5px 4px; }
code.detail { display: block; white-space: pre-wrap; word-break: break-all; font-size: 11px; color: #6b5a48; background: #fffaf3; padding: 8px; border-radius: 8px; margin: 6px 0; }
