/* ===== 立和 · 品牌化工作台样式 =====
   设计语言：羊皮纸暖底 / 深绿主色 / 克制金点缀 / 衬线品牌字 / 有机曲线
   适配：桌面（左侧栏）+ 手机（抽屉式导航 + 顶栏） */

:root {
  /* 主色：深绿（温润不刺眼） */
  --color-primary: #4A6B5A;
  --color-primary-dark: #3A5648;
  --color-primary-deep: #2F4639;
  --color-primary-light: #6B8A78;
  /* 点缀：克制金 */
  --color-accent: #A8884F;
  --color-accent-light: #C4A66B;
  --color-accent-soft: #BFa972;
  /* 羊皮纸暖底体系 */
  --bg-primary: #F2EFE9;
  --bg-page: linear-gradient(180deg, #F5F1E8 0%, #EDE7DB 100%);
  --bg-card: #FFFFFF;
  --bg-card-soft: #FBF8F2;
  --bg-raised: #FAF6EE;
  --bg-sidebar: linear-gradient(180deg, #3C5849 0%, #4A6B5A 55%, #3A5648 100%);
  --bg-sidebar-hover: rgba(255, 255, 255, 0.07);
  /* 文字 */
  --color-text: #2C2A25;
  --color-text-light: #6B665C;
  --color-text-muted: #9A9488;
  /* 边框 */
  --color-border: #E7E0D2;
  --color-border-soft: #EFE9DD;
  /* 功能色 */
  --color-success: #5A8A6B;
  --color-warning: #C4900F;
  --color-danger: #C45A5A;
  --color-info: #5A7A9A;
  /* 阴影：分层、柔和 */
  --shadow-xs: 0 1px 2px rgba(60, 48, 30, 0.05);
  --shadow-sm: 0 1px 3px rgba(60, 48, 30, 0.06), 0 1px 2px rgba(60, 48, 30, 0.04);
  --shadow-md: 0 4px 14px rgba(60, 48, 30, 0.08), 0 2px 4px rgba(60, 48, 30, 0.05);
  --shadow-lg: 0 18px 48px rgba(47, 70, 57, 0.18), 0 4px 12px rgba(47, 70, 57, 0.10);
  /* 圆角 */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  /* 字体 */
  --font-serif: Georgia, "Times New Roman", "Songti SC", "STSong", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  /* 侧栏宽度 */
  --sidebar-w: 236px;
  --topbar-h: 58px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  background-attachment: fixed;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* 极淡的纸纹质感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(168, 136, 79, 0.05), transparent 42%),
    radial-gradient(circle at 84% 88%, rgba(74, 107, 90, 0.06), transparent 46%);
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-primary-light); border-radius: 4px; opacity: 0.6; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(168, 136, 79, 0.18), transparent 60%),
    linear-gradient(135deg, var(--color-primary-deep) 0%, var(--color-primary) 48%, var(--color-primary-dark) 100%);
  position: relative;
  overflow: hidden;
}

/* 有机波浪底边 */
.login-page::before {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 220px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 220' preserveAspectRatio='none'%3E%3Cpath d='M0,120 C240,60 420,180 720,120 C1020,60 1200,180 1440,110 L1440,220 L0,220 Z' fill='%23F2EFE9' opacity='0.95'/%3E%3Cpath d='M0,150 C260,100 480,200 760,150 C1040,100 1240,190 1440,140 L1440,220 L0,220 Z' fill='%23A8884F' opacity='0.10'/%3E%3C/svg%3E") no-repeat bottom;
  background-size: cover;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px 30px 32px;
  width: 460px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.login-card .brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-card .brand .brand-logo {
  height: 64px;
  width: auto;
  margin: 0 auto 10px;
  display: block;
}

.login-card .brand h1 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--color-primary-dark);
  letter-spacing: 2px;
  font-weight: 600;
}

.login-card .brand p {
  color: var(--color-text-light);
  font-size: 12px;
  letter-spacing: 2px;
  margin-top: 5px;
}

.login-card .brand .divider {
  width: 36px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  border-radius: 2px;
  margin: 12px auto 0;
}

.login-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 22px;
  background: var(--bg-card-soft);
  border-radius: var(--radius-pill);
  padding: 4px;
}

.login-tabs button {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: var(--color-text-light);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: var(--transition);
  font-family: inherit;
}
.login-tabs button.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  color: var(--color-text-light);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-card-soft);
  color: var(--color-text);
  transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(168, 136, 79, 0.15);
}

.btn {
  padding: 11px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(74, 107, 90, 0.25);
}
.btn-primary:hover { box-shadow: 0 6px 18px rgba(74, 107, 90, 0.32); filter: brightness(1.04); }

.btn-accent {
  background: linear-gradient(135deg, var(--color-accent-light) 0%, var(--color-accent) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(168, 136, 79, 0.28);
}
.btn-accent:hover { filter: brightness(1.04); box-shadow: 0 6px 18px rgba(168, 136, 79, 0.34); }

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-border);
}
.btn-outline:hover { border-color: var(--color-primary); background: var(--bg-card-soft); }

.btn-success {
  background: linear-gradient(135deg, #6ba07c 0%, var(--color-success) 100%);
  color: #fff;
}
.btn-success:hover { filter: brightness(1.04); }

.btn-block { width: 100%; }
.login-card .btn-primary.btn-block {
  padding: 12px;
  font-size: 14px;
  letter-spacing: 4px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
}
.btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 7px; }

.login-hint {
  margin-top: 18px;
  padding: 12px 16px;
  background: rgba(168, 136, 79, 0.08);
  border: 1px solid rgba(168, 136, 79, 0.18);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-text-light);
  text-align: center;
}
.login-hint code {
  color: var(--color-accent);
  font-weight: 600;
  font-family: var(--font-sans);
  background: rgba(168, 136, 79, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

/* 登录页角色选择 */
.role-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.role-chip {
  padding: 9px 4px;
  border-radius: 9px;
  border: 1.5px solid var(--color-border);
  background: var(--bg-card-soft);
  font-size: 12px;
  color: var(--color-text-light);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  font-family: inherit;
  line-height: 1.4;
}
.role-chip small { display: block; font-size: 10px; color: var(--color-text-muted); margin-top: 1px; }
.role-chip:hover, .role-chip.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(74, 107, 90, 0.06);
}
.role-chip.active { font-weight: 600; box-shadow: var(--shadow-xs); }

.login-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.8;
}

/* ===== 工作台布局 ===== */
.workspace { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: #d4dcc8;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  box-shadow: 1px 0 0 rgba(168, 136, 79, 0.35), 6px 0 24px rgba(47, 70, 57, 0.18);
}

.sidebar-brand {
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sidebar-brand .brand-logo {
  height: 44px;
  width: auto;
  margin-bottom: 0;
}
.sidebar-brand .brand-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 1.5px;
  font-family: var(--font-serif);
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
}

.sidebar-nav .nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.35);
  padding: 14px 14px 8px;
  font-weight: 600;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 11px 14px;
  color: #c4ccc8;
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  transition: var(--transition);
  margin-bottom: 3px;
  position: relative;
}
.sidebar-nav a:hover { background: var(--bg-sidebar-hover); color: #fff; }
.sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
}
/* 金线指示器 */
.sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 22px;
  background: var(--color-accent-light);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(196, 166, 107, 0.6);
}
.sidebar-nav a .nav-badge {
  margin-left: auto;
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent-light), var(--color-accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 15px; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-info .name { color: #fff; font-size: 13px; font-weight: 500; }
.sidebar-user .user-info .role { color: rgba(255, 255, 255, 0.5); font-size: 11px; }
.sidebar-user .logout-btn {
  background: none; border: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer; font-size: 16px; padding: 6px; border-radius: 6px; transition: var(--transition);
}
.sidebar-user .logout-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 26px 32px 32px;
  min-width: 0;
}

/* 页头 */
.page-header {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.page-header h1 {
  font-family: var(--font-serif);
  font-size: 23px;
  color: var(--color-text);
  letter-spacing: 0.5px;
  position: relative;
  padding-bottom: 8px;
}
/* 衬线标题下的金线 */
.page-header h1::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 38px; height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  border-radius: 2px;
}
.page-header .subtitle {
  color: var(--color-text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.topbar { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 600; color: var(--color-text); font-family: var(--font-serif); }
.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

/* 统计卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -20px; top: -20px;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(168, 136, 79, 0.08), transparent 70%);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); }
.stat-card .stat-go {
  position: absolute;
  right: 14px; bottom: 14px;
  font-size: 11px;
  color: var(--color-accent);
  letter-spacing: 0.5px;
  opacity: 0;
  transform: translateX(-4px);
  transition: var(--transition);
}
.stat-card.clickable:hover .stat-go { opacity: 1; transform: translateX(0); }
.stat-card .stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; margin-bottom: 12px;
}
.stat-card .stat-label { font-size: 12px; color: var(--color-text-muted); margin-bottom: 4px; }
.stat-card .stat-value {
  font-size: 28px; font-weight: 700; color: var(--color-text);
  font-family: var(--font-serif);
}
.stat-card .stat-trend { font-size: 11px; color: var(--color-success); margin-top: 4px; }

/* 颜色变体 */
.bg-primary { background: rgba(74, 107, 90, 0.12); color: var(--color-primary); }
.bg-accent { background: rgba(168, 136, 79, 0.14); color: var(--color-accent); }
.bg-success { background: rgba(90, 138, 107, 0.14); color: var(--color-success); }
.bg-warning { background: rgba(196, 144, 15, 0.14); color: var(--color-warning); }
.bg-danger { background: rgba(196, 90, 90, 0.14); color: var(--color-danger); }
.bg-info { background: rgba(90, 122, 154, 0.14); color: var(--color-info); }

/* 进度条 */
.progress-bar {
  width: 100%; height: 8px;
  background: var(--color-border); border-radius: 4px; overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
  border-radius: 4px; transition: width 0.6s ease;
}

/* 表格 */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 11px 16px;
  font-size: 11.5px; color: var(--color-text-muted); font-weight: 600;
  background: var(--bg-card-soft);
  border-bottom: 1px solid var(--color-border);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.data-table td {
  padding: 12px 16px; font-size: 13px;
  border-bottom: 1px solid var(--color-border-soft);
  color: var(--color-text);
}
.data-table tr:hover td { background: rgba(74, 107, 90, 0.035); }
.data-table tr:last-child td { border-bottom: none; }

/* 标签/徽章 */
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 11px; border-radius: 12px;
  font-size: 11px; font-weight: 500; gap: 3px;
}
.tag-primary { background: rgba(74, 107, 90, 0.12); color: var(--color-primary); }
.tag-accent { background: rgba(168, 136, 79, 0.14); color: var(--color-accent); }
.tag-success { background: rgba(90, 138, 107, 0.16); color: var(--color-success); }
.tag-warning { background: rgba(196, 144, 15, 0.16); color: var(--color-warning); }
.tag-danger { background: rgba(196, 90, 90, 0.16); color: var(--color-danger); }
.tag-info { background: rgba(90, 122, 154, 0.16); color: var(--color-info); }
.tag-muted { background: rgba(154, 148, 136, 0.16); color: var(--color-text-muted); }

/* 网格布局 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
@media (max-width: 1024px) {
  .grid-2, .grid-3, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}

/* 时间线（通用） */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px;
  width: 2px; background: var(--color-border);
}
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -17px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-primary); border: 2px solid var(--bg-card);
}
.timeline-item .timeline-time { font-size: 11px; color: var(--color-text-muted); }
.timeline-item .timeline-content { font-size: 13px; color: var(--color-text); margin-top: 2px; }
.timeline-item .timeline-author { font-size: 11px; color: var(--color-text-light); }

/* ===== 模态框 ===== */
.modal-overlay {
  display: none; position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(40, 50, 44, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
#projectOverlay { z-index: 1000; }
#modalOverlay { z-index: 1100; }
#toastContainer { z-index: 2000; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 560px; max-width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-family: var(--font-serif); color: var(--color-text); }
.modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--color-text-muted); padding: 2px 6px; border-radius: 6px; transition: var(--transition);
}
.modal-close:hover { background: var(--bg-card-soft); color: var(--color-text); }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--color-border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* 上传区 */
.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 30px; text-align: center; cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card-soft);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--color-primary);
  background: rgba(74, 107, 90, 0.05);
}
.upload-zone .upload-icon { font-size: 32px; color: var(--color-text-muted); }
.upload-zone p { color: var(--color-text-light); margin-top: 8px; font-size: 13px; }

.file-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg-card-soft);
  border-radius: var(--radius-sm); margin-bottom: 8px;
  border: 1px solid var(--color-border-soft);
}
.file-list-item .file-icon { font-size: 18px; }
.file-list-item .file-info { flex: 1; min-width: 0; }
.file-list-item .file-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list-item .file-meta { font-size: 11px; color: var(--color-text-muted); }

/* 空状态 */
.empty-state { text-align: center; padding: 44px 20px; color: var(--color-text-muted); }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 13px; }

/* 内容区切换 */
.content-section { display: none; }
.content-section.active { display: block; }

/* 公告 */
.announcement-item { padding: 14px 18px; border-bottom: 1px solid var(--color-border-soft); }
.announcement-item:last-child { border-bottom: none; }
.announcement-item.pinned { background: rgba(168, 136, 79, 0.05); }
.announcement-item .ann-title { font-size: 14px; font-weight: 600; color: var(--color-text); display: flex; align-items: center; gap: 6px; }
.announcement-item .ann-meta { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }
.announcement-item .ann-content { font-size: 13px; color: var(--color-text-light); margin-top: 6px; white-space: pre-wrap; line-height: 1.7; }

/* ===== 横向阶段流转 ===== */
.stage-flow {
  display: flex; align-items: flex-start;
  padding: 20px 8px; overflow-x: auto; min-width: 0;
  background: var(--bg-card-soft); border-radius: var(--radius); border: 1px solid var(--color-border-soft);
}
.stage-node {
  flex: 1; min-width: 96px; text-align: center; position: relative; padding-top: 30px;
}
.stage-node .stage-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--color-border); border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--color-border);
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -2px);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1; color: #fff;
}
.stage-node .stage-name {
  font-size: 12px; color: var(--color-text-muted); margin-top: 8px; font-weight: 500; white-space: nowrap;
}
.stage-node .stage-meta { font-size: 10px; color: var(--color-text-muted); margin-top: 2px; white-space: nowrap; }
.stage-node::after {
  content: ""; position: absolute; top: 8px; left: calc(50% + 9px);
  width: calc(100% - 18px); height: 2px; background: var(--color-border);
}
.stage-node:last-child::after { display: none; }
.stage-node.done .stage-dot { background: var(--color-success); box-shadow: 0 0 0 2px var(--color-success); }
.stage-node.done .stage-name { color: var(--color-success); }
.stage-node.active .stage-dot {
  background: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent), 0 0 0 6px rgba(168, 136, 79, 0.15);
  animation: pulse 2s infinite;
}
.stage-node.active .stage-name { color: var(--color-accent); font-weight: 600; }
.stage-node.next .stage-name { color: var(--color-text-light); }
.stage-node.next .stage-dot { background: var(--bg-card); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--color-accent), 0 0 0 6px rgba(168, 136, 79, 0.15); }
  50% { box-shadow: 0 0 0 2px var(--color-accent), 0 0 0 10px rgba(168, 136, 79, 0.05); }
}

/* 客户当前状态卡 */
.customer-current-status {
  background: var(--bg-card); border: 1px dashed var(--color-border);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 16px;
}
.customer-current-status.status-confirm { border-color: var(--color-accent); background: rgba(168, 136, 79, 0.08); }
.customer-current-status.status-progress { border-color: var(--color-primary-light); background: rgba(74, 107, 90, 0.06); }
.customer-current-status .status-title { font-size: 14px; font-weight: 600; color: var(--color-text); margin-bottom: 6px; }
.customer-current-status .status-desc { font-size: 13px; color: var(--color-text-light); margin-bottom: 12px; }
.customer-current-status .status-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== 客户竖向进度时间线 ===== */
.cust-timeline { padding: 4px 0 0 2px; }
.ct-item { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.ct-item:last-child { padding-bottom: 0; }
.ct-item::before {
  content: ""; position: absolute; left: 10px; top: 22px; bottom: -2px; width: 2px; background: var(--color-border);
}
.ct-item:last-child::before { display: none; }
.ct-item.done::before { background: var(--color-success); opacity: .35; }
.ct-dot {
  position: relative; z-index: 1; flex: 0 0 22px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--bg-card); border: 2px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1; color: #fff;
}
.ct-item.done .ct-dot { background: var(--color-success); border-color: var(--color-success); }
.ct-item.active .ct-dot { background: var(--color-accent); border-color: var(--color-accent); }
.ct-item.waiting .ct-dot { background: var(--color-warning); border-color: var(--color-warning); }
.ct-body { flex: 1; min-width: 0; padding-top: 1px; }
.ct-name {
  font-size: 13px; font-weight: 500; color: var(--color-text);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ct-item.next .ct-name { color: var(--color-text-light); font-weight: 400; }
.ct-item.active .ct-name { color: var(--color-accent); font-weight: 600; }
.ct-meta { margin-top: 3px; font-size: 11px; color: var(--color-text-muted); }
.ct-note {
  margin-top: 5px; font-size: 12px; color: var(--color-text);
  background: var(--bg-card-soft); border-left: 3px solid var(--color-accent);
  padding: 5px 8px; border-radius: 4px;
}
.ct-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.ct-files .file-chip { font-size: 12px; padding: 3px 8px; }
.ct-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.ct-actions .btn { flex: 1 1 auto; min-width: 120px; }

/* 任务卡 */
.task-card {
  background: var(--bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; transition: var(--transition);
}
.task-card:hover { box-shadow: var(--shadow-md); }
.task-card .task-title {
  font-size: 13px; font-weight: 600; color: var(--color-text);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.task-card .task-desc { font-size: 12px; color: var(--color-text-light); margin-top: 4px; line-height: 1.6; }
.task-card .task-meta {
  display: flex; align-items: center; gap: 12px; margin-top: 10px;
  font-size: 11px; color: var(--color-text-muted); flex-wrap: wrap;
}
.task-card .task-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* 看板 */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.kanban-col { background: var(--bg-card-soft); border-radius: var(--radius); padding: 12px; min-height: 120px; border: 1px solid var(--color-border-soft); }
.kanban-col .kanban-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 4px 10px; font-size: 12px; font-weight: 600; color: var(--color-text-light);
  border-bottom: 2px solid var(--color-border); margin-bottom: 10px;
}
.kanban-col .kanban-header .count {
  background: var(--bg-card); border-radius: 10px; padding: 1px 8px;
  font-size: 11px; color: var(--color-text-muted);
}
.kanban-col.col-pending .kanban-header { border-color: var(--color-text-muted); }
.kanban-col.col-progress .kanban-header { border-color: var(--color-accent); }
.kanban-col.col-done .kanban-header { border-color: var(--color-success); }

/* 客户卡 */
.customer-card {
  background: var(--bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 16px; transition: var(--transition);
}
.customer-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.customer-card .customer-name { font-size: 14px; font-weight: 600; color: var(--color-text); }
.customer-card .customer-phone { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

/* 反馈气泡 */
.feedback-item { padding: 14px 18px; border-bottom: 1px solid var(--color-border-soft); }
.feedback-item:last-child { border-bottom: none; }
.feedback-item .fb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.feedback-item .fb-content { font-size: 13px; color: var(--color-text); line-height: 1.7; }
.feedback-item .fb-reply {
  margin-top: 10px; padding: 10px 14px;
  background: rgba(74, 107, 90, 0.06); border-left: 3px solid var(--color-primary);
  border-radius: 4px; font-size: 12px; color: var(--color-text-light);
}
.feedback-item .fb-reply .fb-replier { display: block; margin-top: 6px; font-size: 11px; color: var(--color-text-muted); }

/* 项目卡 */
.project-card {
  background: var(--bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 18px 20px; transition: var(--transition); cursor: pointer;
  position: relative; overflow: hidden;
}
.project-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  opacity: 0; transition: var(--transition);
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.project-card:hover::before { opacity: 1; }
.project-card .project-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.project-card .project-name { font-size: 15px; font-weight: 600; color: var(--color-text); font-family: var(--font-serif); }
.project-card .project-code { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.project-card .project-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--color-text-light); margin: 8px 0 12px; }
.project-card .project-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* 标签过滤条 */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filter-chip {
  padding: 6px 15px; border-radius: var(--radius-pill);
  font-size: 12.5px; background: var(--bg-card); border: 1px solid var(--color-border);
  color: var(--color-text-light); cursor: pointer; transition: var(--transition); font-family: inherit;
}
.filter-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.filter-chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; box-shadow: var(--shadow-xs); }
.filter-bar-label { font-size: 13px; color: var(--color-text-muted); margin-right: 4px; white-space: nowrap; }

/* 分段进度 */
.seg-progress { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--color-border); }
.seg-progress .seg { height: 100%; transition: width 0.4s ease; }

/* 通知 */
.notif-btn {
  position: relative; font-size: 18px; padding: 8px 12px;
  border: 1.5px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--bg-card); cursor: pointer; transition: var(--transition);
  font-family: inherit; color: var(--color-text);
}
.notif-btn:hover { border-color: var(--color-primary); background: var(--bg-card-soft); }
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  background: var(--color-danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px; border: 2px solid var(--bg-card);
}
.main-content { position: relative; }
.notif-panel {
  position: absolute; top: 70px; right: 32px;
  width: 360px; max-width: 92vw; max-height: 480px;
  background: var(--bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 200;
  overflow: hidden; display: flex; flex-direction: column;
}
.notif-panel-header {
  padding: 12px 16px; border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600;
}
.notif-panel-body { overflow-y: auto; flex: 1; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--color-border-soft); cursor: pointer; transition: var(--transition); }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(74, 107, 90, 0.04); }
.notif-item.unread { background: rgba(168, 136, 79, 0.06); border-left: 3px solid var(--color-accent); }
.notif-title { font-size: 13px; font-weight: 600; color: var(--color-text); }
.notif-content { font-size: 12px; color: var(--color-text-light); margin-top: 4px; line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }

/* 阶段垂直时间线 */
.stage-timeline { position: relative; padding-left: 28px; }
.stage-timeline::before {
  content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px; width: 2px; background: var(--color-border);
}
.stage-item { position: relative; padding: 0 0 20px 0; }
.stage-item:last-child { padding-bottom: 0; }
.stage-item-dot {
  position: absolute; left: -23px; top: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--color-border); border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--color-border); z-index: 1; transition: var(--transition);
}
.stage-item-dot.active {
  background: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent), 0 0 0 6px rgba(168, 136, 79, 0.15);
  animation: pulse 2s infinite;
}
.stage-item-dot.done { background: var(--color-success); box-shadow: 0 0 0 2px var(--color-success); }
.stage-item-body {
  background: var(--bg-card-soft); border-radius: var(--radius-sm); padding: 12px 16px;
  border: 1px solid var(--color-border); transition: var(--transition);
}
.stage-item.active .stage-item-body { border-color: var(--color-accent); background: rgba(168, 136, 79, 0.04); }
.stage-item.done .stage-item-body { opacity: 0.7; }
.stage-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.stage-item-note {
  font-size: 12px; color: var(--color-text-light); background: rgba(74, 107, 90, 0.06);
  padding: 6px 10px; border-radius: 4px; margin: 6px 0; line-height: 1.5;
}
.stage-item-files { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.stage-item-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* 文件 chip */
.file-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  background: var(--bg-card); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font-size: 12px; color: var(--color-text-light); cursor: pointer; transition: var(--transition);
}
.file-chip:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--bg-card-soft); }
.file-chip-dl { padding: 4px 8px; opacity: .75; border-style: dashed; }
.file-chip-dl:hover { border-color: var(--color-primary); color: var(--color-primary); opacity: 1; }

/* 文件库：下拉与分组 */
.file-stage-select {
  padding: 4px 6px; font-size: 12px; border: 1px dashed var(--color-border);
  border-radius: 4px; background: var(--bg-card); color: var(--color-text-light);
  cursor: pointer; max-width: 150px;
}
.file-stage-select:hover { border-color: var(--color-primary); color: var(--color-primary); }
.file-proj-select {
  padding: 6px 10px; font-size: 13px; border: 1px solid var(--color-border);
  border-radius: 6px; background: var(--bg-card); color: var(--color-text); cursor: pointer; max-width: 320px;
}
.file-proj-select:focus { outline: none; border-color: var(--color-primary); }
.file-group-head { background: var(--bg-card-soft); font-size: 14px; font-weight: 600; color: var(--color-text); padding: 8px 16px; }
.file-stage-group + .file-stage-group { border-top: 1px solid var(--color-border-soft); }
.file-stage-head {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 20px;
  background: rgba(74, 107, 90, 0.08); font-size: 12px; font-weight: 600; color: var(--color-primary);
  border-left: 3px solid var(--color-primary);
}
.mb-3 { margin-bottom: 16px; }

/* 详情面板 */
.panel {
  background: var(--bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 20px; overflow: hidden;
}
.panel-header {
  padding: 14px 20px; border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.panel-header.panel-header-link { cursor: pointer; transition: var(--transition); }
.panel-header.panel-header-link:hover { background: rgba(74, 107, 90, 0.04); }
.panel-header.panel-header-link:hover h3 { color: var(--color-primary); }
.panel-header h3 { font-size: 15px; font-weight: 600; font-family: var(--font-serif); }
.panel-body { padding: 20px; }
.panel-body.no-pad { padding: 0; }

/* 信息行 */
.info-row { display: flex; padding: 8px 0; border-bottom: 1px dashed var(--color-border-soft); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-row .info-label { width: 90px; color: var(--color-text-muted); flex-shrink: 0; }
.info-row .info-value { color: var(--color-text); flex: 1; }

/* ===== 移动端顶栏 + 抽屉 ===== */
.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 820px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
    background: var(--bg-sidebar); color: #fff; z-index: 1300;
    padding: 0 14px; box-shadow: 0 2px 12px rgba(47, 70, 57, 0.25);
  }
  .mobile-topbar .hamburger {
    background: rgba(255, 255, 255, 0.1); border: none; color: #fff;
    width: 40px; height: 40px; border-radius: 10px; font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: var(--transition);
  }
  .mobile-topbar .hamburger:hover { background: rgba(255, 255, 255, 0.18); }
  .mobile-topbar .mt-brand { font-family: var(--font-serif); font-size: 16px; letter-spacing: 1px; flex: 1; }
  .mobile-topbar .mt-notif {
    position: relative; background: rgba(255, 255, 255, 0.1); border: none; color: #fff;
    width: 40px; height: 40px; border-radius: 10px; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
  .mobile-topbar .mt-notif .notif-badge { top: 2px; right: 2px; border-color: var(--color-primary-dark); }

  .sidebar {
    transform: translateX(-100%); width: 250px; z-index: 1400;
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.35);
    padding-top: calc(var(--topbar-h) + 4px);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 1350;
    background: rgba(40, 50, 44, 0.45); opacity: 0; visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
  }
  .sidebar-backdrop.show { opacity: 1; visibility: visible; }

  .main-content { margin-left: 0; padding: calc(var(--topbar-h) + 14px) 14px 24px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-header h1 { font-size: 20px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .notif-panel { top: calc(var(--topbar-h) + 8px); right: 10px; left: 10px; width: auto; }

  /* 文件库手机适配 */
  .filter-bar { gap: 6px; }
  .file-proj-select { max-width: 100%; flex: 1 1 100%; }
  .file-list-item { flex-wrap: wrap; row-gap: 8px; }
  .file-list-item .file-info { flex: 1 1 100%; order: -1; }
  .file-list-item .file-icon { order: -2; }
  .file-stage-select { max-width: 100%; }
  .ct-name { font-size: 14px; }
  .modal { width: 94vw; max-height: 92vh; }
  .login-card { padding: 36px 24px 28px; }

  /* 卡片紧凑化：收小内边距/字号/图标，避免一屏只见一张大卡 */
  .card { border-radius: 10px; }
  .card-header { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .card-body.no-pad { padding: 0; }
  .panel { border-radius: 10px; }
  .panel-header { padding: 12px 14px; }
  .panel-body { padding: 14px; }
  .panel-body.no-pad { padding: 0; }

  .stat-card { padding: 14px; border-radius: 10px; }
  .stat-card .stat-icon { width: 38px; height: 38px; font-size: 17px; border-radius: 9px; margin-bottom: 8px; }
  .stat-card .stat-value { font-size: 22px; }
  .stat-card .stat-label { font-size: 11px; margin-bottom: 2px; }
  .stat-card .stat-go { right: 10px; bottom: 10px; font-size: 10px; }
  .stat-card::after { width: 56px; height: 56px; right: -14px; top: -14px; }

  .project-card { padding: 14px 16px; border-radius: 10px; }
  .project-card .project-name { font-size: 14px; }
  .project-card .project-code { font-size: 11px; }
  .project-card .project-meta { gap: 10px; font-size: 11.5px; margin: 6px 0 10px; }

  .customer-card { padding: 13px 14px; border-radius: 10px; }
  .customer-card .customer-name { font-size: 14px; }
  .task-card { padding: 12px 14px; border-radius: 10px; }
  .customer-current-status { padding: 12px 14px; border-radius: 10px; }
  .stage-flow { padding: 16px 6px; }
  .page-header { margin-bottom: 16px; }
  .stat-grid { gap: 8px; }

  /* 表格在窄屏可横向滚动，避免撑破布局、保持美感 */
  .panel-body, .card-body, .modal-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel-body > table, .card-body > table, .modal-body > table { width: 100%; border-collapse: collapse; }
  /* 手机顶栏品牌加金色圆点点缀，更有设计感 */
  .mobile-topbar .mt-brand::before {
    content: ""; display: inline-block; width: 6px; height: 6px;
    border-radius: 50%; background: var(--color-accent); margin-right: 8px; vertical-align: middle;
  }
}

@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header h1 { font-size: 19px; }
  .login-card { width: 92vw; padding: 32px 22px 26px; }
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 12px; }
.text-bold { font-weight: 600; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; } .gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.cursor-pointer { cursor: pointer; }
.hidden { display: none !important; }

