* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #FAF6F0 0%, #F5EEE2 100%);
  color: #3E2723;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== 顶部导航 ===== */
.topnav {
  background: linear-gradient(135deg, #4A2409 0%, #8B4513 100%);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(93,46,12,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #FFD9A0;
  font-size: 20px;
  font-weight: 700;
  padding: 18px 0;
  letter-spacing: 1px;
}
.topnav .brand .icon {
  width: 36px; height: 36px;
  background: rgba(255,217,160,0.2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.topnav .nav {
  display: flex;
  gap: 4px;
}
.topnav .nav a {
  color: #D9C4A8;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14.5px;
  transition: all 0.25s;
  font-weight: 500;
}
.topnav .nav a:hover { background: rgba(255,217,160,0.12); color: #FFD9A0; }
.topnav .nav a.active {
  background: rgba(255,217,160,0.22);
  color: #FFF;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.topnav .user {
  color: #C9A67B;
  font-size: 13px;
}

/* ===== 主内容区 ===== */
.main-wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 40px 60px;
}
.page-title {
  font-size: 28px;
  font-weight: 700;
  color: #4A2409;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.page-sub {
  font-size: 14px;
  color: #A0826D;
  margin-bottom: 28px;
}

/* ===== 卡片 ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: #FFF;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(93,46,12,0.06);
  border: 1px solid #F0E6D8;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(93,46,12,0.15);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #8B4513, #D2B48C);
}
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #FDF6EE, #F0E6D8);
}
.stat-card .stat-num {
  font-size: 34px;
  font-weight: 700;
  color: #5D2E0C;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -1px;
}
.stat-card .stat-label {
  font-size: 13px;
  color: #A0826D;
}
.stat-card.warn .stat-num { color: #C0392B; }
.stat-card.good .stat-num { color: #27AE60; }

/* ===== 区块 ===== */
.section-box {
  background: #FFF;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(93,46,12,0.06);
  border: 1px solid #F0E6D8;
  margin-bottom: 24px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.section-head h3 {
  font-size: 17px;
  color: #4A2409;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-head h3::before {
  content: '';
  width: 4px; height: 18px;
  background: linear-gradient(180deg, #8B4513, #D2B48C);
  border-radius: 2px;
}

/* ===== 按钮 ===== */
.btn {
  padding: 10px 22px;
  background: linear-gradient(135deg, #8B4513, #5D2E0C);
  color: #FFF;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(139,69,19,0.25);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(139,69,19,0.35);
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 6px;
  background: #8B4513;
  color: #FFF;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-sm:hover { background: #5D2E0C; }
.btn-danger { background: #C0392B; }
.btn-danger:hover { background: #A93226; }
.btn-ghost {
  background: #F0E6D8;
  color: #5D2E0C;
  box-shadow: none;
}
.btn-ghost:hover { background: #E8DCC8; }

/* ===== 表格 ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #FFF;
  border-radius: 12px;
  overflow: hidden;
}
.data-table thead th {
  background: #F5EEE2;
  color: #5D2E0C;
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #E8DCC8;
}
.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #F5EEE2;
  color: #3E2723;
  font-size: 13.5px;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #FDF8F3; }

/* ===== 进度条 ===== */
.progress-bar {
  height: 8px;
  background: #F0E6D8;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8B4513, #D2B48C);
  border-radius: 4px;
  transition: width 0.4s;
}

/* ===== 状态标签 ===== */
.status-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.status-todo { background: #F0E6D8; color: #5D2E0C; }
.status-doing { background: #FFF3CD; color: # #856404; }
.status-done5 { background: #D4EDDA; color: #155724; }
.status-overdue { background: #F8D7DA; color: #721C24; }

/* ===== 工具条 ===== */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar select, .toolbar input {
  padding: 10px 16px;
  border: 1px solid #E8DCC8;
  border-radius: 10px;
  background: #FFF;
  color: #3E2723;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}
.toolbar select:focus, .toolbar input:focus {
  border-color: #8B4513;
  box-shadow: 0 0 0 3px rgba(139,69,19,0.1);
}

/* ===== 空状态 ===== */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: #A0826D;
}
.empty .icon { font-size: 56px; margin-bottom: 16px; opacity: 0.4; }
.loading { text-align: center; padding: 60px; color: #A0826D; font-size: 15px; }
.error { color: #C0392B; padding: 24px; text-align: center; }

/* ===== 登录页 ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #3D1E08 0%, #8B4513 100%);
}
.login-box {
  background: #FFF;
  padding: 52px 44px;
  border-radius: 24px;
  width: 420px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.login-box h1 { color:D2E0C; font-size: 28px; text-align: center; margin-bottom: 10px; letter-spacing: 1px; font-weight: 700; }
.login-box .sub { color: #A0826D; text-align: center; font-size: 13px; margin-bottom: 36px; }
.login-box input {
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 1px solid #E8DCC8;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
  background: #FAF6F0;
}
.login-box input:focus { border-color: #8B4513; background: #FFF; box-shadow: 0 0 0 3px rgba(139,69,19,0.1); }
.login-box button {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #8B4513, #5D2E0C);
  color: #FFF;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 3px;
  transition: all 0.25s;
  margin-top: 8px;
}
.login-box button:hover { box-shadow: 0 10px 24px rgba(139,69,19,0.4); transform: translateY(-1px); }
.login-box button:disabled { background: #C9A67B; cursor: not-allowed; }
.login-box .tip { font-size: 12px; color: #A0826D; text-align: center; margin-top: 18px; }
.login-box .msg { color: #C0392B; text-align: center; margin-top: 14px; min-height: 20px; font-size: 13px; }


/* ==== 导航防换行 ==== */
.topnav .nav { flex-wrap: nowrap; }
.topnav .nav a { white-space: nowrap; }

/* ==== 第二排外链条 ==== */
.ext-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 24px;
  background: #F5EDE0;
  border-bottom: 1px solid #E8DCC8;
  font-size: 14px;
  flex-wrap: wrap;
}
.ext-bar .ext-label {
  color: #8B4513;
  font-weight: 600;
}
.ext-bar a {
  color: #5D2E0C;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background .15s;
}
.ext-bar a:hover {
  background: #E8DCC8;
  color: #8B4513;
}
