/* =========================================================================
   公共基础样式 (common.css)
   被 frontend.css / user.css 依赖；定义设计令牌 + 通用组件 + 工具类
   与后台 admin 风格保持一致（靛蓝主色 + 浅灰底 + 白卡片）
   ========================================================================= */

:root {
  --brand: #4f46e5;  --brand-600: #4338ca;  --brand-700: #3730a3;
  --brand-50: #eef2ff; --brand-100: #e0e7ff; --brand-soft: #eef2ff; --brand-soft-2: #c7d2fe;
  --green: #16a34a;  --green-bg: #dcfce7;   --green-700: #15803d;
  --amber: #d97706;  --amber-bg: #fef3c7;   --amber-700: #b45309;
  --red: #dc2626;    --red-bg: #fee2e2;     --red-700: #b91c1c;
  --blue: #2563eb;   --blue-bg: #dbeafe;    --blue-700: #1d4ed8;
  --violet: #7c3aed; --violet-bg: #ede9fe;  --violet-700: #6d28d9;
  --teal: #0d9488;   --teal-bg: #ccfbf1;    --teal-700: #0f766e;
  --bg: #f4f6fb; --surface: #fff; --surface-2: #f8fafc;
  --text: #1e293b; --text-2: #475569; --text-3: #94a3b8;
  --line: #e6eaf1; --line-2: #eef2f7;
  --radius: 14px; --radius-sm: 11px; --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 6px 20px rgba(15,23,42,.08);
  --shadow-lg: 0 18px 50px rgba(15,23,42,.18);
  --ring: 0 0 0 3px rgba(79,70,229,.18);
  --font: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; color: var(--text); line-height: 1.3; }
img { max-width: 100%; }
.svg-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- 按钮 ---------- */
.btn, .btn2, .qnr-btn, .action-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; line-height: 1;
  transition: all .16s ease; white-space: nowrap; user-select: none;
}
.btn:hover, .qnr-btn:hover, .action-link:hover { transform: translateY(-1px); }
.btn-primary, .btn-success, .btn-danger, .btn-info, .btn-claim, .uc-claim-btn { color: #fff; }
.btn-primary { background: linear-gradient(135deg, #6366f1, var(--brand)); box-shadow: 0 4px 12px rgba(79,70,229,.3); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-success { background: linear-gradient(135deg, #22c55e, var(--green)); box-shadow: 0 4px 12px rgba(22,163,74,.26); }
.btn-success:hover { filter: brightness(1.06); }
.btn-danger { background: linear-gradient(135deg, #ef4444, var(--red)); box-shadow: 0 4px 12px rgba(220,38,38,.24); }
.btn-danger:hover { filter: brightness(1.06); }
.btn-info { background: linear-gradient(135deg, #0ea5e9, var(--blue)); box-shadow: 0 4px 12px rgba(37,99,235,.24); }
.btn-info:hover { filter: brightness(1.06); }
.btn-ghost, .btn-secondary, .btn-default { background: #fff; color: var(--text-2); border-color: var(--line); }
.btn-ghost:hover, .btn-secondary:hover, .btn-default:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-close { background: var(--surface-2); border: none; color: var(--text-2); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.btn-close:hover { background: var(--red-bg); color: var(--red); }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 14px; font-weight: 650; color: var(--text); margin-bottom: 7px; }
.required-mark { color: var(--red); margin-left: 3px; }
.form-desc { font-size: 12.5px; color: var(--text-3); margin: -3px 0 8px; line-height: 1.5; }
.form-input, .form-control, .form-textarea, .form-select {
  width: 100%; padding: 10px 13px; font-size: 14px; font-family: inherit;
  color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.form-input, .form-control, .form-select { height: 42px; }
.form-textarea { min-height: 96px; line-height: 1.55; resize: vertical; }
.form-input:focus, .form-control:focus, .form-textarea:focus, .form-select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > .form-group { flex: 1; min-width: 200px; }
.form-hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.form-file { width: 100%; font-size: 13px; color: var(--text-2); }
.form-range { flex: 1; accent-color: var(--brand); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden;
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fbfcfe, #fff); }
.card-header h3 { font-size: 15px; font-weight: 700; }
.card-body { padding: 18px 20px; }

/* ---------- 徽章 / 状态 ---------- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.badge.blue { background: var(--blue-bg); color: var(--blue-700); } .badge.green { background: var(--green-bg); color: var(--green-700); }
.badge.amber { background: var(--amber-bg); color: var(--amber-700); } .badge.red { background: var(--red-bg); color: var(--red-700); }
.badge.violet { background: var(--violet-bg); color: var(--violet-700); }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 20px; font-size: 12.5px; font-weight: 650; }
.status-submitted, .status-draft { color: var(--blue-700); background: var(--blue-bg); }
.status-reviewing, .status-first_review_passed { color: var(--amber-700); background: var(--amber-bg); }
.status-passed, .status-approved { color: var(--green-700); background: var(--green-bg); }
.status-rejected, .status-returned, .status-closed { color: var(--red-700); background: var(--red-bg); }
.status-incomplete { color: var(--violet-700); background: var(--violet-bg); }

/* ---------- 提示 / 告警 ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13.5px; border: 1px solid transparent; }
.alert-success { background: var(--green-bg); color: var(--green-700); border-color: #bbeccb; }
.alert-error, .alert-danger { background: var(--red-bg); color: var(--red-700); border-color: #f7cfca; }
.alert-info { background: var(--blue-bg); color: var(--blue-700); border-color: #c7dbff; }
.alert-warning { background: var(--amber-bg); color: var(--amber-700); border-color: #f5dfa6; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table thead th { background: var(--surface-2); color: var(--text-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: var(--brand-soft); }

/* ---------- 分页 / 标签 / 下拉 ---------- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; justify-content: center; }
.page-item { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 9px; color: var(--text-2); font-size: 13px; font-weight: 600; background: #fff; transition: all .15s; }
.page-item:hover { border-color: var(--brand); color: var(--brand); }
.page-item.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab-item { padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-item.active { color: var(--brand); border-bottom-color: var(--brand); }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; z-index: 70; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 8px; color: var(--text-2); font-size: 13px; }
.dropdown-item:hover { background: var(--brand-soft); color: var(--brand); }
.dropdown-divider { height: 1px; background: var(--line); margin: 5px 4px; }

/* ---------- 空状态 ---------- */
.empty-text, .uc-empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.uc-empty-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.uc-empty-desc { font-size: 13px; margin: 0; }

/* ---------- 模态框 ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 1500; background: rgba(15,23,42,.55); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 6vh 20px; }
.modal-overlay.open { display: flex; animation: dsFade .18s ease; }
.modal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; overflow: hidden; animation: dsZoom .22s ease; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: linear-gradient(135deg, var(--brand), #6366f1); color: #fff; }
.modal-header h3 { font-size: 15.5px; font-weight: 700; color: #fff; }
.modal-close { background: rgba(255,255,255,.18); border: none; color: #fff; width: 30px; height: 30px; border-radius: 8px; font-size: 18px; cursor: pointer; }
.modal-close:hover { background: rgba(255,255,255,.32); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-footer button { height: 36px; padding: 0 18px; border-radius: var(--radius-xs); border: none; font-size: 13px; font-weight: 600; cursor: pointer; }
.modal-btn-cancel { background: #fff; color: var(--text-2); border: 1px solid var(--line); }
.modal-btn-cancel:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.modal-btn-confirm { background: linear-gradient(135deg, #6366f1, var(--brand)); color: #fff; }
.modal-btn-confirm:hover { filter: brightness(1.06); }

/* ---------- 网安备案图标 ---------- */
.wangan-icon { display: inline-flex; align-items: center; width: 14px; height: 14px; margin-right: 3px; vertical-align: -2px; flex: none; }
.wangan-icon img { width: 100%; height: 100%; display: block; object-fit: contain; }

/* ---------- 工具类 ---------- */
.d-flex { display: flex; } .d-inline-flex { display: inline-flex; }
.flex-wrap { flex-wrap: wrap; } .align-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.flex-1 { flex: 1; } .flex-none { flex: none; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 20px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 20px; }
.p-2 { padding: 8px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; }
.text-muted { color: var(--text-3); } .text-center { text-align: center; } .text-right { text-align: right; }
.fw-semibold { font-weight: 600; } .fw-bold { font-weight: 700; }
.w-100 { width: 100%; } .h-100 { height: 100%; }
.border { border: 1px solid var(--line); } .rounded { border-radius: var(--radius-sm); }
.hidden, [hidden] { display: none !important; }
.small { font-size: 12.5px; }

@keyframes dsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dsZoom { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
