/* 教研空间 · 全局样式 */

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --success: #34a853;
  --warning: #fbbc04;
  --danger: #ea4335;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f4;
  --gray-200: #e8eaed;
  --gray-300: #dadce0;
  --gray-500: #9aa0a6;
  --gray-700: #5f6368;
  --gray-900: #202124;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(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, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 布局 */
.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.page { padding: 24px 0; }

/* 导航栏 */
.navbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.navbar-brand { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 8px; }
.navbar-brand .logo-icon { width: 32px; height: 32px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; }
.navbar-user { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--gray-700); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius); border: none; cursor: pointer;
  font-size: 0.9rem; font-weight: 500; transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 卡片 */
.card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; }
.card-subtitle { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 8px; }

/* 列表 */
.list { display: flex; flex-direction: column; gap: 12px; }
.list-item {
  background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 16px; display: flex; justify-content: space-between; align-items: center;
  transition: box-shadow 0.15s;
}
.list-item:hover { box-shadow: var(--shadow); }
.list-item-body { flex: 1; }
.list-item-title { font-weight: 600; margin-bottom: 4px; }
.list-item-meta { font-size: 0.85rem; color: var(--gray-500); }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; color: var(--gray-700); }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius);
  font-size: 0.9rem; background: white; color: var(--gray-900);
}
.form-input:focus, .form-textarea:focus, .form-select:focus { outline: none; border-color: var(--primary); }
.form-textarea { min-height: 80px; resize: vertical; }

/* 标签 */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 500;
}
.badge-draft { background: var(--gray-100); color: var(--gray-700); }
.badge-pending { background: #fff3e0; color: #e65100; }
.badge-published { background: #e8f5e9; color: #2e7d32; }
.badge-rejected { background: #ffebee; color: #c62828; }
.badge-closed { background: var(--gray-200); color: var(--gray-500); }

/* 状态 */
.empty { text-align: center; padding: 48px 16px; color: var(--gray-500); }
.loading { text-align: center; padding: 48px; color: var(--gray-500); }
.error { background: #ffebee; color: #c62828; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.success { background: #e8f5e9; color: #2e7d32; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }

/* 网格 */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* 分段器 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-200); margin-bottom: 16px; }
.tab {
  padding: 10px 16px; font-size: 0.9rem; font-weight: 500; color: var(--gray-500);
  border-bottom: 2px solid transparent; cursor: pointer; background: none; border: none;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--gray-200); font-size: 0.9rem; }
.table th { font-weight: 600; color: var(--gray-700); background: var(--gray-50); }
.table tr:hover { background: var(--gray-50); }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%); }
.login-card { background: white; padding: 40px; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; }
.login-card h1 { text-align: center; margin-bottom: 24px; }

/* 二维码 */
.qr-box { width: 200px; height: 200px; background: white; border: 1px solid var(--gray-300); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; margin: 16px auto; }
