/* ========== 全局样式 ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #4A90D9;
  --primary-light: #E8F4FD;
  --success: #67C23A;
  --warning: #E6A23C;
  --danger: #F56C6C;
  --info: #909399;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --text: #303133;
  --text-secondary: #909399;
  --border: #DCDFE6;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body { overflow: hidden; }

/* ========== 登录页 ========== */
#login-page {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; background: linear-gradient(135deg, #4A90D9 0%, #357ABD 100%);
}
.login-container {
  background: white; border-radius: 20px; padding: 48px 40px;
  width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center;
}
.login-logo { font-size: 64px; margin-bottom: 16px; }
.login-container h1 { font-size: 22px; color: var(--primary); margin-bottom: 4px; }
.login-container h2 { font-size: 15px; color: var(--text-secondary); font-weight: normal; margin-bottom: 32px; }
.login-hint { font-size: 13px; color: var(--text-secondary); margin-top: 16px; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 15px; transition: border-color 0.2s;
  background: #FAFAFA;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); background: white;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* ========== 按钮 ========== */
.btn {
  padding: 10px 20px; border: 1px solid var(--border); border-radius: 8px;
  background: white; color: var(--text); font-size: 15px; cursor: pointer;
  transition: all 0.2s; font-weight: 500;
}
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: #357ABD; }
.btn-sm { padding: 6px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }

/* ========== 顶部栏 ========== */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: white; border-bottom: 1px solid var(--border);
  height: 56px;
}
.top-bar h1 { font-size: 17px; color: var(--primary); }
.top-bar-right { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-secondary); }

/* ========== 导航标签 ========== */
.tab-nav {
  display: flex; background: white; border-bottom: 2px solid var(--border);
  padding: 0 24px; gap: 4px;
}
.tab-btn {
  padding: 12px 24px; border: none; background: none; font-size: 15px;
  color: var(--text-secondary); cursor: pointer; border-bottom: 3px solid transparent;
  transition: all 0.2s; font-weight: 500;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ========== 页面内容 ========== */
.tab-content { display: none; height: calc(100vh - 56px - 49px); overflow-y: auto; padding: 20px 24px; }
.tab-content.active { display: block; }

/* ========== 工具栏 ========== */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-left input, .toolbar-left select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: white;
}
.toolbar-right { font-size: 14px; color: var(--text-secondary); }

/* ========== 卡片列表 ========== */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: white; border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); transition: transform 0.15s;
  border-left: 4px solid var(--primary);
}
.card:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-size: 17px; font-weight: 600; }
.card-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.card-body { font-size: 14px; line-height: 1.8; color: var(--text); }
.card-footer { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }

/* ========== 状态标签 ========== */
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.status-waiting { background: #FFF3E0; color: #E65100; }
.status-confirmed { background: #E8F5E9; color: #2E7D32; }
.status-completed { background: #E3F2FD; color: #1565C0; }
.status-cancelled { background: #FFEBEE; color: #C62828; }
.status-todo { background: #FFF3E0; color: #E65100; }
.status-done { background: #E8F5E9; color: #2E7D32; }
.status-active { background: #E8F5E9; color: #2E7D32; }
.status-paused { background: #FFF3E0; color: #E65100; }
.status-graduated { background: #E3F2FD; color: #1565C0; }

/* ========== 弹窗 ========== */
.modal {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
  background: white; border-radius: 16px; width: 520px; max-height: 85vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-lg { width: 720px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; }
.modal-close {
  width: 32px; height: 32px; border: none; background: var(--bg);
  border-radius: 50%; font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; color: var(--text-secondary);
}
.modal-close:hover { background: #FEE; color: var(--danger); }
.modal-body { padding: 24px; }

/* ========== 时间线 ========== */
.timeline-list { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex; gap: 16px; padding: 20px 0; border-left: 3px solid var(--border);
  margin-left: 16px; padding-left: 24px; position: relative;
}
.timeline-item::before {
  content: ''; position: absolute; left: -9px; top: 24px;
  width: 15px; height: 15px; border-radius: 50%; background: var(--primary);
  border: 3px solid white; box-shadow: 0 0 0 2px var(--primary);
}
.timeline-date { font-size: 13px; color: var(--text-secondary); white-space: nowrap; min-width: 80px; }
.timeline-card { background: white; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); flex: 1; }

/* ========== 空状态 ========== */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.empty-state p { font-size: 15px; }

/* ========== 详情页 ========== */
.detail-section { margin-bottom: 20px; }
.detail-section h4 { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--primary); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.detail-row { display: flex; gap: 8px; }
.detail-row label { font-size: 13px; color: var(--text-secondary); white-space: nowrap; min-width: 70px; }
.detail-row span { font-size: 14px; }

/* ========== 时间线日期头 ========== */
.timeline-date-header { font-size: 14px; font-weight: 600; color: var(--text-secondary); padding: 12px 0; }

/* ========== 隐藏/显示 ========== */
.page { display: none; }
.page.active { display: block; }
.page.active#main-page { height: 100vh; display: flex; flex-direction: column; }
