/* ============================================
   公司资料管理系统 - 样式表
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #dbeafe;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Login Page ---------- */
.container {
  display: flex;
  min-height: 100vh;
}

.brand-section {
  flex: 1;
  background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 50%, #60a5fa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.brand-section::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  top: -100px;
  right: -100px;
}

.brand-section::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  bottom: -50px;
  left: -50px;
}

.brand-content {
  text-align: center;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.brand-logo-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,0.35);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.brand-content h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 20px 0 8px;
}

.brand-subtitle {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 32px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.1);
  padding: 12px 20px;
  border-radius: var(--radius);
  backdrop-filter: blur(4px);
  font-size: 14px;
}

.feature-icon {
  font-size: 20px;
}

.auth-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #fff;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  position: relative;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-form h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.auth-desc {
  color: var(--gray-500);
  font-size: 14px;
  margin-bottom: 28px;
}

/* ---------- Form Elements ---------- */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray-800);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 13px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--gray-600);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.forgot-link {
  color: var(--primary);
  font-size: 13px;
}

.forgot-link:hover {
  text-decoration: underline;
}

.switch-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--gray-500);
}

.guest-divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  color: var(--gray-400);
  font-size: 12px;
  gap: 12px;
}

.guest-divider::before,
.guest-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.btn-ghost {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--gray-300);
  color: var(--gray-500);
  font-size: 13px;
}

.btn-ghost:hover {
  border-color: var(--gray-400);
  background: var(--gray-50);
  color: var(--gray-700);
}

.admin-hint {
  text-align: center;
  margin-top: 16px;
  font-size: 11px;
  color: var(--gray-400);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  gap: 6px;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-icon {
  padding: 6px 10px;
  font-size: 16px;
  line-height: 1;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

/* ---------- Message Box ---------- */
.message-box {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  display: none;
}

.message-box.error {
  display: block;
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.message-box.success {
  display: block;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* ---------- Dashboard ---------- */
.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--gray-800);
}

.header-logo-img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gray-200);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  font-size: 14px;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 4px 12px;
  border-radius: 20px;
}

.role-badge-header {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
}

.role-admin-header {
  background: #fef3c7;
  color: #92400e;
}

.role-user-header {
  background: #dbeafe;
  color: #1d4ed8;
}

.role-guest {
  background: #f3e8ff;
  color: #7c3aed;
}

.guest-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #b91c1c;
}

.doc-card-readonly {
  opacity: 0.97;
}

.doc-card-footer-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--gray-200);
  font-size: 11px;
  color: var(--gray-400);
  text-align: right;
}

.dashboard-body {
  display: flex;
  flex: 1;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 200px;
  background: #fff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-800);
  text-decoration: none;
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-icon {
  font-size: 18px;
}

.sidebar-footer {
  padding: 8px 16px;
  font-size: 11px;
  color: var(--gray-400);
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 60px);
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-content.active {
  display: block;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.content-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

/* ---------- Search ---------- */
.search-box {
  position: relative;
  width: 300px;
}

.search-box input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}

/* ---------- Document Grid ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.doc-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s;
  position: relative;
}

.doc-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.doc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.doc-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  flex: 1;
}

.doc-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.doc-card-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.doc-card-actions button:hover {
  background: var(--gray-100);
}

.doc-card-actions .delete-btn:hover {
  background: #fef2f2;
}

.doc-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.doc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.doc-badge.category {
  background: #dbeafe;
  color: #1d4ed8;
}

.doc-badge.department {
  background: #f3e8ff;
  color: #7c3aed;
}

.doc-badge.date {
  background: var(--gray-100);
  color: var(--gray-600);
}

.doc-card-content {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-card-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.doc-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--gray-100);
  color: var(--gray-600);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
}

/* ---------- Add Form ---------- */
.add-form-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 640px;
  box-shadow: var(--shadow-sm);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.required {
  color: var(--danger);
}

.add-form-card .btn {
  margin-top: 8px;
}

/* ---------- Stats ---------- */
#statsContent {
  display: grid;
  gap: 20px;
}

.stats-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.stats-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 16px;
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.stat-item {
  text-align: center;
  padding: 16px;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.stats-list {
  list-style: none;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}

.stats-list li:last-child {
  border-bottom: none;
}

.stats-list .count {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0 4px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--gray-700);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 0 24px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-footer .btn {
  width: auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .brand-section {
    padding: 32px 20px;
  }

  .brand-content h1 {
    font-size: 20px;
  }

  .auth-section {
    padding: 24px 20px;
  }

  .auth-card {
    padding: 20px;
  }

  .form-group label {
    font-size: 13px;
  }

  .form-group input, .form-group select, .form-group textarea {
    font-size: 15px; /* 避免iOS缩放 */
    padding: 10px 12px;
  }

  .dashboard-body {
    flex-direction: column;
    padding-top: 56px; /* 为顶部留空间 */
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    flex-direction: row;
    padding: 6px 4px;
    border-right: none;
    border-top: 1px solid var(--gray-200);
    z-index: 100;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  }

  .sidebar-nav {
    flex-direction: row;
    flex: 1;
    padding: 0;
    overflow-x: auto;
    justify-content: space-around;
    gap: 0;
  }

  .sidebar-footer {
    display: none;
  }

  .nav-item {
    white-space: nowrap;
    padding: 8px 6px;
    font-size: 11px;
    flex-direction: column;
    gap: 2px;
    border-radius: 8px;
    min-width: 50px;
    text-align: center;
  }

  .nav-item .nav-icon {
    font-size: 18px;
  }

  .nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
  }

  .dashboard-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
    padding: 10px 14px;
  }

  .header-logo span {
    font-size: 14px;
  }

  .header-logo-img {
    width: 28px;
    height: 28px;
  }

  .main-content {
    padding: 14px 14px 80px 14px; /* 底部留 tab 空间 */
    max-height: none;
  }

  .doc-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .doc-card {
    padding: 14px;
  }

  .doc-card-title {
    font-size: 14px;
  }

  .doc-card-meta {
    flex-wrap: wrap;
    gap: 4px;
  }

  .doc-badge {
    font-size: 11px;
    padding: 2px 8px;
  }

  .doc-card-actions button {
    font-size: 16px;
    padding: 4px 8px;
  }

  .doc-card-content {
    font-size: 13px;
    line-height: 1.5;
  }

  .doc-tag {
    font-size: 11px;
    padding: 2px 8px;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    font-size: 14px;
    padding: 10px 36px 10px 14px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .content-header h2 {
    font-size: 17px;
  }

  /* 统计页 */
  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-item {
    padding: 12px 8px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stats-card {
    padding: 16px;
  }

  .stats-card h3 {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .stats-list li {
    font-size: 13px;
    padding: 8px 0;
  }

  /* 弹窗 */
  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    padding: 16px;
    margin: 0;
    height: 100vh;
    overflow-y: auto;
  }

  /* 用户管理表格 - 手机改卡片 */
  .user-table {
    font-size: 13px;
  }

  .user-table th, .user-table td {
    padding: 8px 10px;
  }

  .action-cell {
    flex-direction: column;
    gap: 4px;
  }

  .action-cell .btn {
    width: 100%;
    text-align: center;
    font-size: 12px;
    padding: 6px 10px;
  }

  /* 按钮 */
  .btn {
    padding: 10px 18px;
    font-size: 14px;
  }

  .add-form-card {
    padding: 16px;
  }

  /* 游客横幅 */
  .guest-banner {
    font-size: 12px;
    padding: 8px 12px;
  }

  /* 过期徽章 */
  .expiry-badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* 文件预览 */
  .file-link {
    font-size: 12px;
    padding: 5px 8px;
  }

  .file-link-name {
    font-size: 12px;
  }
}

/* 小屏手机 (≤ 400px) 进一步紧凑 */
@media (max-width: 400px) {
  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-value {
    font-size: 18px;
  }

  .nav-item {
    font-size: 10px;
    padding: 6px 4px;
    min-width: 44px;
  }

  .nav-item .nav-icon {
    font-size: 16px;
  }

  .doc-card {
    padding: 12px;
  }

  .modal-card {
    padding: 12px;
  }

  .main-content {
    padding: 10px 10px 70px 10px;
  }
}

.user-management-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 768px) {
  .user-management-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 用户管理表格 ---------- */
.user-table-wrapper {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.user-table th {
  background: var(--gray-50);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: 13px;
  border-bottom: 1px solid var(--gray-200);
}

.user-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
}

.user-table tr:last-child td {
  border-bottom: none;
}

.user-table tr:hover {
  background: var(--gray-50);
}

.role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.role-admin {
  background: #fef3c7;
  color: #92400e;
}

.role-user {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-self {
  display: inline-block;
  font-size: 11px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.builtin-tag {
  font-size: 12px;
  color: var(--gray-400);
}

.date-cell {
  font-size: 13px;
  color: var(--gray-500);
}

.action-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

/* ---------- Scrollbar ---------- */
.main-content::-webkit-scrollbar {
  width: 6px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ---------- 过期提醒样式 ---------- */
.expiry-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  display: inline-block;
}

.expiry-expired {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.expiry-warning {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.expiry-ok {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.card-expired {
  border-left: 4px solid #dc2626 !important;
}

.card-expiring {
  border-left: 4px solid #f59e0b !important;
}

/* ---------- 文件上传样式 ---------- */
.file-upload-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-upload-wrapper input[type="file"] {
  font-size: 13px;
  padding: 8px 0;
}

.file-preview {
  min-height: 0;
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
}

.file-icon {
  font-size: 18px;
}

.file-name {
  flex: 1;
  color: var(--gray-700);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--gray-400);
  font-size: 12px;
  flex-shrink: 0;
}

/* 卡片内的文件链接 */
.doc-card-file {
  margin-top: 10px;
}

.file-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s;
}

.file-link:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.file-link-name {
  flex: 1;
  color: var(--primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-link-size {
  color: var(--gray-400);
  font-size: 11px;
}

.hint {
  font-weight: 400;
  font-size: 11px;
  color: var(--gray-400);
}
