/* ==================== 基础变量 ==================== */
:root {
  --primary: #4a90d9;
  --primary-dark: #357abd;
  --accent: #e8913a;
  --bg: #f5f6f8;
  --card-bg: #ffffff;
  --text: #333333;
  --text-secondary: #666666;
  --text-hint: #999999;
  --border: #e0e0e0;
  --danger: #d9534f;
  --success: #5cb85c;
  --warning: #f0ad4e;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ==================== 基础样式 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

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

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

/* ==================== 顶部栏 ==================== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--primary);
}

.top-bar h1 { font-size: 22px; }

.week-badge, .person-badge {
  padding: 6px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 14px;
  margin-left: 8px;
}

.status-dot { font-size: 18px; margin-left: 8px; }

/* ==================== 卡片 ==================== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card h2 { margin-bottom: 16px; font-size: 18px; }
.card h3 { margin-bottom: 12px; font-size: 16px; }

/* ==================== 表单元素 ==================== */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}

textarea {
  resize: vertical;
  min-height: 60px;
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 14px; }

.hint { color: var(--text-hint); font-size: 13px; }
.required { color: var(--danger); }

/* ==================== 按钮 ==================== */
.btn-primary {
  padding: 10px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

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

.btn-secondary {
  padding: 10px 28px;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover { background: #f0f6ff; }

.btn-small {
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-small:hover { background: var(--bg); }

.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #fff5f5; }

button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==================== 项目卡片 ==================== */
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: box-shadow 0.2s;
}

.project-card:hover { box-shadow: var(--shadow); }

.project-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.project-num {
  background: var(--primary);
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 13px;
  white-space: nowrap;
}

.project-name {
  font-weight: 600;
  font-size: 16px;
  flex: 1;
}

.project-code {
  color: var(--text-hint);
  font-size: 12px;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
}

.project-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.meta-tag {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 4px;
}

/* ==================== 季度进展 ==================== */
.quarterly-section {
  background: #fafafa;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.quarterly-section summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  user-select: none;
}

.quarterly-content {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background: #f0f0f0;
  border-radius: 6px;
}

/* ==================== 参考区域 ==================== */
.ref-section {
  background: #fffbf0;
  border-left: 3px solid var(--warning);
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: 0 8px 8px 0;
}

.ref-label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: #8a6d3b;
}

.ref-row {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 14px;
}

.ref-tag {
  background: var(--warning);
  color: #fff;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  align-self: flex-start;
}

/* ==================== 填写区域 ==================== */
.fill-section {
  margin-top: 4px;
}

.fill-label {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--accent);
}

.field-group {
  margin-bottom: 14px;
}

.field-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 14px;
}

.work-input, .plan-input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  transition: border 0.2s;
}

.work-input:focus { border-color: var(--accent); }
.plan-input:focus { border-color: var(--primary); }

.card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ==================== 底部操作栏 ==================== */
.sticky-bottom {
  position: sticky;
  bottom: 16px;
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
}

/* ==================== 分组标题 ==================== */
.group-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  padding: 12px 0 8px;
  margin-top: 8px;
  border-bottom: 1px dashed var(--border);
}

/* ==================== 进度条 ==================== */
.progress-summary {
  padding: 12px 16px;
  background: #f0f8ff;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 15px;
}

.progress-bar {
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.3s;
}

/* ==================== 成功页面 ==================== */
.success-card {
  text-align: center;
  padding: 48px;
}

.success-card h2 { font-size: 28px; margin-bottom: 16px; }

/* ==================== Tab ==================== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab {
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

/* ==================== 数据表 ==================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  background: var(--bg);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover { background: #fafbfc; }

/* ==================== 链接行 ==================== */
.link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.link-person {
  font-weight: 600;
  min-width: 70px;
}

.link-url {
  flex: 1;
  color: var(--primary);
  word-break: break-all;
  font-size: 13px;
}

/* ==================== 筛选行 ==================== */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
  background: var(--bg);
  border-radius: 8px;
}

/* ==================== 弹窗 ==================== */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius);
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

.modal-body { padding: 20px; }

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

/* ==================== 响应式 ==================== */
@media (max-width: 600px) {
  .container { padding: 8px; }
  .card { padding: 16px; }
  .top-bar { flex-direction: column; gap: 8px; }
  .sticky-bottom { flex-direction: column; }
  .form-row { flex-direction: column; }
}
