/* ========================================
   儿子暑期学习规划 - 打印友好样式
   ======================================== */

:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --secondary: #f97316;
  --secondary-light: #fb923c;
  --success: #22c55e;
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #1e293b;
  --text-gray: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg-light);
}

/* ========================================
   导航栏
   ======================================== */
.navbar {
  background: var(--bg-card);
  box-shadow: var(--shadow);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 30px;
}

.nav-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 5px;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-gray);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.nav-links a:hover {
  background: var(--bg-light);
  color: var(--primary);
}

.nav-links a.active {
  background: var(--primary);
  color: white;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
}

/* ========================================
   页面容器
   ======================================== */
.page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* ========================================
   头部
   ======================================== */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 40px 30px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.header .subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

.header .meta {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  font-size: 0.95rem;
  opacity: 0.85;
}

.header .meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========================================
   核心规则卡片
   ======================================== */
.rules-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.rules-card h2 {
  color: var(--primary);
  font-size: 1.3rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.rule-item {
  background: var(--bg-light);
  padding: 15px;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.rule-item .icon {
  font-size: 1.3rem;
}

.rule-item .content strong {
  display: block;
  color: var(--primary);
  margin-bottom: 3px;
}

.rule-item .content small {
  color: var(--text-gray);
  font-size: 0.85rem;
}

/* ========================================
   周卡片
   ======================================== */
.week-card {
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.week-header {
  background: var(--primary);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.week-header h3 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.week-header .goal {
  font-size: 0.85rem;
  opacity: 0.85;
}

.week-table {
  width: 100%;
  border-collapse: collapse;
}

.week-table th,
.week-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.week-table th {
  background: var(--bg-light);
  font-weight: 600;
  color: var(--text-gray);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.week-table tr:last-child td {
  border-bottom: none;
}

.week-table tr:hover {
  background: var(--bg-light);
}

.week-table .date {
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.week-table .check {
  color: var(--success);
  font-size: 1.1rem;
}

.week-table .status {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-light);
  color: var(--text-gray);
}

.week-table .status.done {
  background: #dcfce7;
  color: #166534;
}

.week-table .status.pending {
  background: #fef3c7;
  color: #92400e;
}

/* ========================================
   概览板块
   ======================================== */
.overview-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
}

.overview-section h2 {
  color: var(--primary);
  font-size: 1.3rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.overview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: var(--bg-light);
  border-radius: 10px;
  transition: transform 0.2s;
}

.overview-item:hover {
  transform: translateY(-2px);
}

.overview-item .icon {
  font-size: 1.8rem;
}

.overview-item .info h4 {
  color: var(--text-dark);
  margin-bottom: 3px;
}

.overview-item .info small {
  color: var(--text-gray);
  font-size: 0.8rem;
}

.overview-item .badge {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.overview-item .badge.star {
  background: #fef3c7;
  color: #92400e;
}

.overview-item .badge.check {
  background: #dcfce7;
  color: #166534;
}

.overview-item .badge.clock {
  background: #e0f2fe;
  color: #075985;
}

/* ========================================
   原则提醒
   ======================================== */
.principles-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
}

.principles-section h2 {
  color: var(--primary);
  font-size: 1.3rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.principle-card {
  background: var(--bg-light);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 15px;
}

.principle-card:last-child {
  margin-bottom: 0;
}

.principle-card h4 {
  color: var(--secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.principle-card ul {
  list-style: none;
  padding-left: 0;
}

.principle-card li {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  color: var(--text-gray);
}

.principle-card li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* ========================================
   时间线总览
   ======================================== */
.timeline-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
}

.timeline-section h2 {
  color: var(--primary);
  font-size: 1.3rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-card);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item .year {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 3px;
}

.timeline-item .desc {
  color: var(--text-gray);
  font-size: 0.9rem;
}

/* ========================================
   页脚
   ======================================== */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-gray);
  font-size: 0.85rem;
}

.footer .date {
  margin-bottom: 5px;
}

/* ========================================
   打印样式
   ======================================== */
@media print {
  body {
    background: white;
    font-size: 11pt;
  }

  .navbar {
    display: none;
  }

  .page-container {
    max-width: 100%;
    padding: 0;
  }

  .header {
    background: var(--primary) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    border-radius: 0;
    margin-bottom: 20px;
  }

  .week-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid var(--border);
    margin-bottom: 15px;
  }

  .week-header {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .week-table tr:hover {
    background: none;
  }

  .rules-card,
  .overview-section,
  .principles-section,
  .timeline-section {
    box-shadow: none;
    border: 1px solid var(--border);
  }

  .principle-card,
  .overview-item {
    break-inside: avoid;
  }

  @page {
    margin: 1.5cm;
  }
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 10px 20px;
    box-shadow: var(--shadow);
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: block;
  }
}

@media (max-width: 600px) {
  .header {
    padding: 25px 20px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .header .meta {
    flex-direction: column;
    gap: 8px;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .week-table {
    font-size: 0.85rem;
  }

  .week-table th,
  .week-table td {
    padding: 10px 8px;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }
}