* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; background: #f0f2f5; color: #1a1a1a; -webkit-font-smoothing: antialiased; font-size: 14px; }
a { color: #0057B8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 登录页 */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, #dbe8ff, transparent 40%), radial-gradient(circle at 80% 80%, #d1f0e0, transparent 40%), #f0f2f5;
}
.login-box { width: 400px; background: #fff; border-radius: 16px; padding: 40px; box-shadow: 0 20px 60px rgba(0, 40, 90, .12); }
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand h1 { margin: 0 0 6px; color: #0057B8; font-size: 22px; font-weight: 700; }
.login-brand p { margin: 0; color: #6b7280; font-size: 13px; }
.login-form label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 6px; margin-top: 14px; }
.login-form input { width: 100%; padding: 12px 14px; border: 1px solid #e5e9f0; border-radius: 8px; font-size: 14px; outline: none; transition: border .15s; }
.login-form input:focus { border-color: #0057B8; }
.login-form button { width: 100%; margin-top: 20px; padding: 12px; background: linear-gradient(135deg, #0057B8, #007ce8); color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 20px rgba(0, 87, 184, .3); }
.login-form button:hover { transform: translateY(-1px); }
.login-hint { margin-top: 16px; padding: 12px; background: #f0f7ff; border-radius: 8px; font-size: 12px; color: #4b5563; line-height: 1.6; }
.login-err { margin-top: 12px; padding: 10px; background: #fee; color: #c72525; border-radius: 6px; font-size: 13px; text-align: center; }

/* 布局 */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: linear-gradient(180deg, #003a80 0%, #0057B8 100%); color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.brand-logo { width: 40px; height: 40px; background: rgba(255, 255, 255, .18); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.brand-title { font-size: 15px; font-weight: 700; }
.brand-sub { font-size: 10px; opacity: .7; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 20px; color: rgba(255, 255, 255, .8); text-decoration: none; font-size: 14px; transition: all .15s; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-nav a.active { background: rgba(255, 255, 255, .15); color: #fff; border-left: 3px solid #14915a; padding-left: 17px; }
.sidebar-nav a span { font-size: 16px; }

.sidebar-user { padding: 16px 20px; border-top: 1px solid rgba(255, 255, 255, .1); }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; opacity: .7; margin-top: 2px; }
.user-logout { display: inline-block; margin-top: 8px; font-size: 12px; color: rgba(255, 255, 255, .7); }
.user-logout:hover { color: #fff; }

.main { flex: 1; overflow-y: auto; }
.main-content { padding: 28px 32px; max-width: 1400px; }

/* 顶部标题 */
.page-title { display: flex; justify-content: space-between; align-items: center; margin: 0 0 24px; }
.page-title h1 { margin: 0; font-size: 22px; font-weight: 600; color: #1a1a1a; }
.page-title .subtitle { color: #6b7280; font-size: 13px; margin-top: 4px; }

/* 卡片 */
.card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0, 20, 60, .04); margin-bottom: 20px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 16px; color: #1a1a1a; }

/* Dashboard 数据卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 10px; padding: 18px; position: relative; overflow: hidden; border-left: 4px solid #0057B8; }
.stat-card.g { border-left-color: #14915a; }
.stat-card.y { border-left-color: #c17f00; }
.stat-card.r { border-left-color: #c72525; }
.stat-num { font-size: 30px; font-weight: 700; color: #1a1a1a; line-height: 1; }
.stat-label { font-size: 12px; color: #6b7280; margin-top: 6px; }
.stat-icon { position: absolute; top: 12px; right: 14px; font-size: 24px; opacity: .3; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th, table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef2f7; }
table th { background: #f7f9fc; font-weight: 600; color: #4b5563; font-size: 12px; }
table tr:hover td { background: #f7f9fc; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; }
.tag.blue { background: #eaf2ff; color: #0057B8; }
.tag.green { background: #e6f7ec; color: #14915a; }
.tag.yellow { background: #fff8e1; color: #a06600; }
.tag.gray { background: #f0f2f5; color: #6b7280; }
.tag.red { background: #fee; color: #c72525; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: linear-gradient(135deg, #0057B8, #007ce8); color: #fff; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn:hover { transform: translateY(-1px); text-decoration: none; color: #fff; }
.btn.secondary { background: #fff; color: #0057B8; border: 1px solid #e5e9f0; }
.btn.secondary:hover { background: #f7f9fc; color: #0057B8; }
.btn.small { padding: 4px 10px; font-size: 12px; }

/* 表单 */
.form-row { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: center; margin-bottom: 16px; }
.form-row label { color: #4b5563; font-size: 13px; text-align: right; }
.form-row label .req { color: #c72525; }
.form-row input, .form-row select, .form-row textarea { width: 100%; padding: 8px 12px; border: 1px solid #e5e9f0; border-radius: 6px; font-size: 13px; outline: none; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: #0057B8; }
.form-actions { padding-top: 16px; border-top: 1px solid #eef2f7; margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* 成功提示 */
.alert-success { padding: 12px 16px; background: #e6f7ec; color: #14915a; border-left: 4px solid #14915a; border-radius: 4px; margin-bottom: 20px; font-size: 13px; }

/* Dashboard 双列 */
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }

/* 二维码展示 */
.qr-preview { text-align: center; padding: 24px; }
.qr-preview img { max-width: 300px; width: 100%; border-radius: 8px; border: 1px solid #eef2f7; padding: 8px; background: #fff; }
.qr-preview .qr-code { font-family: 'Consolas', monospace; color: #0057B8; font-size: 18px; font-weight: 600; margin-top: 12px; }
.qr-preview .qr-batch { color: #6b7280; font-size: 12px; margin-top: 4px; font-family: 'Consolas', monospace; }

/* 详情行 */
.detail-row { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #eef2f7; font-size: 13px; }
.detail-row .k { color: #6b7280; }
.detail-row .v { color: #1a1a1a; font-weight: 500; }

/* 时间线（后台） */
.tl { list-style: none; padding: 0; margin: 0; }
.tl li { position: relative; padding: 6px 0 6px 24px; border-left: 2px solid #e5e9f0; margin-left: 6px; }
.tl li::before { content: ''; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.tl li.done::before { background: #14915a; }
.tl li.current::before { background: #0057B8; box-shadow: 0 0 0 3px #eaf2ff; }
.tl li .t { font-size: 13px; font-weight: 600; }
.tl li .d { font-size: 11px; color: #8892a6; margin-top: 2px; }
