* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: #f0f4f8;
    color: #1f2937;
    font-size: 14px;
}

/* ---------- 登录页 ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
}
.login-card {
    width: 380px;
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; color: #111827; }
.login-card .sub { text-align: center; color: #6b7280; font-size: 13px; margin-bottom: 28px; }
.login-card label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; }
.login-card input {
    width: 100%; height: 42px; border: 1px solid #d1d5db; border-radius: 8px;
    padding: 0 12px; font-size: 14px; outline: none; margin-bottom: 18px;
    transition: border-color .2s;
}
.login-card input:focus { border-color: #2563eb; }
.btn-primary {
    width: 100%; height: 44px; background: #2563eb; color: #fff; border: none;
    border-radius: 8px; font-size: 15px; cursor: pointer; transition: background .2s;
}
.btn-primary:hover { background: #1d4ed8; }
.login-tip { margin-top: 16px; font-size: 12px; color: #9ca3af; text-align: center; line-height: 1.8; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 210px; background: #111827; color: #d1d5db; flex-shrink: 0;
    display: flex; flex-direction: column;
}
.sidebar .logo { padding: 20px 18px; font-size: 17px; font-weight: 700; color: #fff; border-bottom: 1px solid #1f2937; }
.sidebar .logo span { color: #60a5fa; }
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a {
    display: block; padding: 12px 20px; color: #9ca3af; text-decoration: none;
    font-size: 14px; transition: all .15s; cursor: pointer; border-left: 3px solid transparent;
}
.sidebar nav a:hover { color: #fff; background: #1f2937; }
.sidebar nav a.active { color: #fff; background: #2563eb; border-left-color: #93c5fd; }
.sidebar .user { padding: 16px 18px; border-top: 1px solid #1f2937; font-size: 13px; }
.sidebar .user .logout { color: #f87171; cursor: pointer; margin-left: 8px; }

.main { flex: 1; padding: 24px; min-width: 0; }
.page { display: none; }
.page.active { display: block; }
.page-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: #111827; }

/* ---------- 卡片 ---------- */
.card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: #111827; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-card .label { font-size: 13px; color: #6b7280; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.stat-card .value.blue { color: #2563eb; }
.stat-card .value.green { color: #059669; }
.stat-card .value.amber { color: #d97706; }
.stat-card .value.red { color: #dc2626; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; }
th { background: #f9fafb; text-align: left; padding: 10px 12px; font-size: 13px; color: #6b7280; font-weight: 600; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
tr:hover td { background: #f8fafc; }
.table-wrap { overflow-x: auto; }

/* ---------- 标签 ---------- */
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 20px; }
.tag-unused { background: #dbeafe; color: #1d4ed8; }
.tag-used { background: #d1fae5; color: #065f46; }
.tag-frozen { background: #fef3c7; color: #b45309; }
.tag-expired { background: #fee2e2; color: #b91c1c; }
.tag-pending { background: #fef3c7; color: #b45309; }
.tag-approved { background: #d1fae5; color: #065f46; }
.tag-rejected { background: #fee2e2; color: #b91c1c; }
.tag-enabled { background: #d1fae5; color: #065f46; }
.tag-disabled { background: #e5e7eb; color: #4b5563; }

/* ---------- 表单 ---------- */
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.form-item label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 5px; }
.form-item input, .form-item select {
    height: 36px; border: 1px solid #d1d5db; border-radius: 8px; padding: 0 10px;
    font-size: 13px; outline: none; background: #fff; min-width: 140px;
}
.form-item input:focus, .form-item select:focus { border-color: #2563eb; }
.btn {
    height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid #d1d5db;
    background: #fff; color: #374151; font-size: 13px; cursor: pointer; transition: all .15s;
}
.btn:hover { border-color: #9ca3af; }
.btn-blue { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-blue:hover { background: #1d4ed8; }
.btn-green { background: #059669; border-color: #059669; color: #fff; }
.btn-green:hover { background: #047857; }
.btn-red { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-red:hover { background: #b91c1c; }
.btn-amber { background: #d97706; border-color: #d97706; color: #fff; }
.btn-amber:hover { background: #b45309; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 8px; margin-top: 14px; justify-content: flex-end; font-size: 13px; color: #6b7280; }
.pager button { height: 28px; min-width: 28px; border: 1px solid #d1d5db; background: #fff; border-radius: 6px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager button.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* ---------- 其他 ---------- */
.empty { text-align: center; color: #9ca3af; padding: 30px 0; font-size: 13px; }
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: #111827; color: #fff; padding: 10px 20px; border-radius: 8px;
    font-size: 13px; z-index: 9999; opacity: 0; transition: opacity .25s; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { background: #dc2626; }
.mono { font-family: Consolas, monospace; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 460px; max-width: 92vw; }
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.modal .btn-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- 成员端页签 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #e5e7eb; margin-bottom: 18px; }
.tabs a { padding: 10px 20px; cursor: pointer; color: #6b7280; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -2px; text-decoration: none; }
.tabs a.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

/* ---------- 工作区子页签 ---------- */
.sub-nav { display: flex; gap: 4px; border-bottom: 2px solid #e5e7eb; margin-bottom: 16px; }
.sub-nav a { padding: 8px 16px; cursor: pointer; color: #6b7280; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -2px; text-decoration: none; user-select: none; }
.sub-nav a.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

/* ---------- 生成历史（批次卡片） ---------- */
.batch-card { border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.batch-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; background: #fafbfc; transition: background .2s; }
.batch-head:hover { background: #f1f5f9; }
.batch-head.open { background: #eff6ff; }
.batch-arrow { font-size: 12px; color: #9ca3af; transition: transform .2s; }
.batch-head.open .batch-arrow { transform: rotate(180deg); }
.batch-body { display: none; border-top: 1px solid #e5e7eb; padding: 12px; background: #fff; }
