/* 
===============================================
鼎沛文化 - 项目管理系统 V1 样式表
===============================================
*/

/* ========== Vue初始化防闪烁 ========== */
/* 作用：隐藏未初始化的Vue模板，避免页面加载时闪烁 */
/* 原理：Vue初始化完成后会自动移除v-cloak属性 */
/* ========== 全局链接样式 ========== */
/* 作用：去除所有链接的默认下划线 */
a, a:hover, a:focus, a:active, a:visited {
  text-decoration: none !important;
}

[v-cloak] { display: none !important; }

/* ========== 全局变量 ========== */
:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #dbeafe;
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  
  --bg-body: #f3f4f6;
  --bg-white: #ffffff;
  --bg-sidebar: #f9fafb;
  --bg-sidebar-hover: #e5e7eb;
  
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --radius: 8px;
  --radius-sm: 6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ========== 登录页 ========== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.login-box {
  background: var(--bg-white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 360px;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  width: 48px; height: 48px;
  background: var(--primary);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: white;
  font-weight: 700;
  font-size: 16px;
}

.login-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.login-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ========== 表单 ========== */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.15s;
  background: var(--bg-white);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  gap: 6px;
}

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

.btn-success {
  background: var(--success);
  color: white;
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-secondary {
  background: white;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; padding: 11px; }

/* ========== 布局 ========== */
.main-layout {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  height: 100vh;
}

/* ========== 侧边栏 ========== */
.sidebar {
  width: 150px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}

.sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-img {
  width: 40px;
  height: auto;
  vertical-align: middle;
  position: relative;
  top: -4px;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-left: 8px;
  vertical-align: middle;
}

.nav-menu {
  list-style: none;
  padding: 20px 0;
  flex: 1;
}

/* 菜单项间距统一 */
.nav-menu li {
  margin: 0;
}

/* 菜单链接样式 - 去除默认下划线 */
.nav-menu a,
.nav-link {
  display: block;
  padding: 10px 26px;
  color: var(--text-secondary);
  text-decoration: none !important;
  font-size: 14px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-menu a:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-primary);
  text-decoration: none !important;
}

.nav-link.active,
.nav-menu a.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  text-decoration: none !important;
}

.sidebar-footer {
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.sidebar-footer .nav-link {
  padding: 10px 26px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  display: block;
  text-decoration: none !important;
}

.sidebar-footer .nav-link:hover {
  text-decoration: none !important;
}

.menu-icon {
  font-size: 15px;
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

.sidebar-toggle {
  display: none;
}

/* ========== 内容区 ========== */
.content {
  flex: 1;
  margin-left: 150px;
  padding: 20px;
  height: 100vh;
  overflow-y: auto;
}

/* ========== 页头 ========== */
.page-header {
  margin-bottom: 20px;
}

.page-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.page-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* ========== 统计卡片 ========== */
/* 作用：显示项目关键数据概览 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-white);
  padding: 14px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 标题样式 - 缩小字体 */
.stat-card h3 {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 6px;
  text-align: center;
}

/* 数值样式 - 缩小字体 */
.stat-card .value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.stat-card .value.primary { color: var(--primary); }
.stat-card .value.success { color: var(--success); }
.stat-card .value.danger { color: var(--danger); }

/* 筛选按钮组 */
.filter-group { display:flex;align-items:center;gap:4px;flex-wrap:wrap }
.filter-btn { padding:4px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;font-size:12px;cursor:pointer;color:#6b7280;transition:all .2s }
.filter-btn:hover { border-color:var(--primary);color:var(--primary) }
.filter-btn.active { background:var(--primary);border-color:var(--primary);color:#fff }

/* ========== 卡片 ========== */
.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.card-header {
  padding: 5px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.card-body { padding: 12px 16px; }

/* ========== 表格 ========== */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

th {
  background: #f1f5f9;
  font-weight: 600;
  color: #334155;
  font-size: 12px;
  text-transform: none;
}

tbody tr {
  background: var(--bg-white);
  transition: background 0.15s;
}

tbody tr:hover {
  background: #f8fafc;
}

/* ========== 表格样式 ========== */
/* 作用：统一表格显示风格 */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* 产品明细表格 - 字体紧凑 */
.product-table th,
.product-table td {
  padding: 6px 8px;
  font-size: 12px;
}

.product-table th {
  padding: 6px 8px;
  font-size: 12px;
}

/* 汇总行样式 - 用于产品明细合计 */
.summary-row {
  background: #f8fafc;
  border-top: 2px solid var(--primary);
  font-weight: 600;
}
.summary-row td {
  padding: 12px 16px;
}

/* 排序按钮样式 - 用于产品明细上下移动 */
.sort-buttons {
  display: inline-flex;
  flex-direction: column;
  gap: 0;
  line-height: 1;
}
.btn-sort-up, .btn-sort-down {
  width: 18px;
  height: 16px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  line-height: 16px;
  transition: color 0.15s;
}
.btn-sort-up:hover:not(:disabled), .btn-sort-down:hover:not(:disabled) {
  color: #3b82f6;
}
.btn-sort-up:disabled, .btn-sort-down:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ========== 状态标签 ========== */
.status-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-tag.pending { background: var(--warning-light); color: #92400e; }
.status-tag.in-progress { background: var(--primary-light); color: #1e40af; }
.status-tag.completed { background: var(--success-light); color: #065f46; }
.status-tag.cancelled { background: var(--danger-light); color: #991b1b; }
.role-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.role-tag.admin { background: var(--primary-light); color: #1e40af; }
.role-tag.user { background: #f3f4f6; color: #6b7280; }
.status-tag.shipped { background: #f3e8ff; color: #6b21a8; }

/* ========== 发票状态 ========== */
.invoice-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.invoice-tag.pending { background: var(--warning-light); color: #92400e; }
.invoice-tag.in-progress { background: var(--primary-light); color: #1e40af; }
.invoice-tag.completed { background: var(--success-light); color: #065f46; }

/* ========== 筛选栏 ========== */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-bar input,
.filter-bar select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.filter-bar input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ========== 项目汇总 ========== */
/* 项目汇总样式 - 每行4个，紧凑布局 */
.project-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

/* 特殊情况：5列布局 */
.project-summary.five-cols {
  grid-template-columns: repeat(5, 1fr);
}
.summary-item.full-width {
  grid-column: 1 / -1;
}
.text-warning {
  color: #f59e0b;
}

.summary-item {
  background: #f9fafb;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.summary-item label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 1px;
}

.summary-item .value {
  font-size: 13px;
  font-weight: 600;
}

/* ========== 跟进列表 ========== */
/* 作用：紧凑显示跟进事项 */
.followup-list { list-style: none; padding: 0; margin: 0; }

.followup-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light);
}

.followup-list li input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--primary);
}

.followup-list li .followup-content { flex: 1; font-size: 13px; }
.followup-list li.done .followup-content {
  text-decoration: line-through;
  color: var(--text-muted);
}

.followup-list li .delete-btn { opacity: 0; font-size: 11px; padding: 2px 6px; }
.followup-list li:hover .delete-btn { opacity: 1; }

.add-followup {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.add-followup input {
  flex: 1;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* ========== 模态框 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.modal.wide { max-width: 720px; }

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body { padding: 20px; }

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #f9fafb;
}

/* ========== Toast提示 ========== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
}

.toast {
  background: var(--bg-white);
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 8px;
  border-left: 4px solid var(--success);
  font-size: 14px;
}

.toast.error { border-left-color: var(--danger); }

/* ========== 加载状态 ========== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* ========== 返回链接 ========== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 16px;
}

.back-link:hover { color: var(--primary); }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  .content { margin-left: 0; padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal { width: 95%; }
  .filter-bar { flex-direction: column; }
}

@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ===== 重大事件公告栏 ===== */
.events-board{min-height:calc(100vh - 100px);background:radial-gradient(ellipse at 30% 50%,#0b1628 0%,#0f2035 20%,#142a45 40%,#1a3a5a 60%,#1e4a6e 80%,#235a80 100%);position:relative;overflow:hidden;padding:0;margin:10px;border-radius:20px;box-shadow:0 8px 32px rgba(0,0,0,0.3)}
.events-board::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:radial-gradient(ellipse at 30% 50%,rgba(10,40,100,0.4) 0%,transparent 50%);pointer-events:none;z-index:0;border-radius:20px}
.events-header{background:rgba(0,0,0,0.55);padding:14px 28px;display:flex;align-items:center;justify-content:space-between;backdrop-filter:blur(12px);border-bottom:2px solid rgba(100,160,255,0.2);position:relative;z-index:2;border-radius:20px 20px 0 0;margin:8px 8px 0 8px}
.events-header-left{display:flex;align-items:center;gap:12px}
.events-header-left h2{color:#fff;margin:0;font-size:20px;display:flex;align-items:center;gap:8px}
.events-header-left .events-count{color:rgba(255,255,255,0.65);font-size:13px}
.events-canvas{position:relative;min-height:calc(100vh - 200px);width:100%;padding:40px 20px 50px;z-index:1;perspective:1200px;margin-top:16px;border-top:1px solid rgba(100,160,255,0.12)}
.sticky-note{position:absolute;border-radius:3px;padding:14px 12px;box-shadow:2px 3px 12px rgba(0,0,0,0.3),0 1px 3px rgba(0,0,0,0.2);cursor:grab;user-select:none;min-width:180px;min-height:100px;overflow:hidden;display:flex;flex-direction:column;transition:transform 0.3s ease,box-shadow 0.3s ease;z-index:1;transform-origin:center center}
.sticky-note:hover{box-shadow:4px 6px 24px rgba(0,0,0,0.45);transform:scale(1.05);z-index:100!important}
.sticky-note.dragging{cursor:grabbing;box-shadow:8px 10px 30px rgba(0,0,0,0.5);z-index:9999!important;opacity:0.92;transform:scale(1.08) rotate(0deg)!important}
.sticky-note.color-yellow{background:#fde68a}
.sticky-note.color-blue{background:#93c5fd}
.sticky-note.color-purple{background:#c084fc}
.sticky-note.color-orange{background:#fdba74}
.sticky-note.color-green{background:#86efac}
.sticky-note.color-pink{background:#f9a8d4}
.sticky-note.depth-back{box-shadow:1px 2px 8px rgba(0,0,0,0.2);opacity:0.88;filter:brightness(0.92)}
.sticky-note.depth-mid{box-shadow:2px 4px 14px rgba(0,0,0,0.3)}
.sticky-note.depth-front{box-shadow:3px 5px 20px rgba(0,0,0,0.4)}
.sticky-note::before{content:'';position:absolute;top:-8px;left:50%;transform:translateX(-50%) rotate(-3deg);width:50px;height:14px;background:rgba(255,255,255,0.5);border:1px solid rgba(200,200,200,0.2);border-radius:2px;z-index:2}
.sticky-note-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;padding-bottom:8px;border-bottom:1px dashed rgba(0,0,0,0.15)}
.sticky-note-title{font-weight:800;font-size:16px;color:#222;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.4;text-decoration:none!important;cursor:pointer;transition:color 0.15s}
.sticky-note-title:hover{color:#1d4ed8;text-decoration:none!important}
.sticky-note-badge{background:rgba(0,0,0,0.15);color:#444;font-size:13px;padding:3px 10px;border-radius:10px;white-space:nowrap;flex-shrink:0;margin-left:6px;font-weight:600}
.sticky-note-body{flex:1;overflow-y:auto;overflow-x:hidden;font-size:15px;font-weight:600;color:#333;line-height:1.7;padding-right:4px}
.sticky-note-body::-webkit-scrollbar{width:4px}
.sticky-note-body::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.15);border-radius:2px}
.followup-item{padding:3px 0;display:flex;gap:6px;align-items:flex-start}
.followup-item .item-num{color:#888;font-size:12px;flex-shrink:0;min-width:16px}
.followup-item .item-text{flex:1;word-break:break-all}
.followup-item.is-done .item-text{text-decoration:line-through;color:#999}
.sticky-note .resize-handle{position:absolute;bottom:0;right:0;width:18px;height:18px;cursor:nwse-resize;opacity:0;transition:opacity 0.2s}
.sticky-note:hover .resize-handle{opacity:0.5}
.resize-handle::after{content:'';position:absolute;bottom:4px;right:4px;width:8px;height:8px;border-right:2px solid #888;border-bottom:2px solid #888}
.btn-edit-layout{background:rgba(255,152,0,0.9);color:#fff;border:none;padding:6px 16px;border-radius:6px;font-size:13px;cursor:pointer;display:flex;align-items:center;gap:4px;transition:background 0.2s}
.btn-edit-layout:hover{background:rgba(255,152,0,1)}
.events-empty{color:rgba(255,255,255,0.5);text-align:center;padding:80px 20px;font-size:16px}
