/* 阅读科学管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f0f2f5;
  color: #333;
  font-size: 14px;
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E5AA8 0%, #5BA3D0 100%);
}

.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo .logo-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

.login-logo-img {
  width: 200px;
  height: auto;
  object-fit: contain;
  margin-bottom: 0;
}

.login-logo h1 {
  font-size: 28px;
  color: #1E5AA8;
  margin-bottom: 4px;
}

.login-logo p {
  color: #999;
  font-size: 14px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.login-form input:focus {
  outline: none;
  border-color: #1E5AA8;
}

.login-tip {
  text-align: center;
  margin-top: 20px;
  color: #bbb;
  font-size: 12px;
}

/* 登录页底部备案信息（湖北/武汉标准：主体 + ICP号，ICP号链接到工信部） */
.login-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  row-gap: 6px;
  gap: 14px;
  font-size: 12px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: .3px;
}
.login-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}
.login-footer a:hover {
  text-decoration: underline;
}
.beian-police {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.beian-icon {
  width: 14px;
  height: 15px;
  object-fit: contain;
  vertical-align: middle;
}

/* 按钮 */
.btn-primary {
  background: #1E5AA8;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-primary:hover { background: #1a4e94; }

.btn-outline {
  background: #fff;
  color: #1E5AA8;
  border: 1px solid #1E5AA8;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.btn-outline:hover { background: #f0f7ff; }

.btn-danger {
  background: #fff;
  color: #e74c3c;
  border: 1px solid #e74c3c;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.btn-success {
  background: #fff;
  color: #27ae60;
  border: 1px solid #27ae60;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.btn-block { width: 100%; padding: 14px; font-size: 16px; }

/* 主布局 */
.main-app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 168px;
  background: #001529;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}

.sidebar-logo {
  padding: 10px 8px;
  border-bottom: 1px solid #1f3a5f;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo .logo-icon { font-size: 24px; }

.sidebar-logo-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #1f3a5f #001529;
}

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: #001529; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #1f3a5f; border-radius: 3px; }

/* 侧栏分组框：每组菜单套一个浅色描边圆角框，组间留间隔 */
.nav-group {
  margin: 6px 8px;
  border: 1px solid #234268;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.nav-item {
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a0b4d0;
  transition: all 0.2s;
  position: relative;
  font-size: 14px;
}

.nav-item:hover {
  background: #1f3a5f;
  color: #fff;
}

.nav-item.active {
  background: #1E5AA8;
  color: #fff;
}

.nav-icon { font-size: 18px; }

.badge {
  position: absolute;
  right: 16px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #1f3a5f;
}

.user-info {
  margin-bottom: 12px;
  font-size: 14px;
}

.btn-logout {
  width: 100%;
  background: transparent;
  color: #a0b4d0;
  border: 1px solid #1f3a5f;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-logout:hover { color: #fff; border-color: #e74c3c; }

/* 主内容 */
.main-content {
  flex: 1;
  margin-left: 168px;
  padding: 24px;
  padding-bottom: 60px;
}

.app-footer {
  position: fixed;
  bottom: 0;
  left: 168px;
  right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: #999;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  z-index: 100;
}
.app-footer a {
  color: #999;
  text-decoration: none;
}
.app-footer a:hover {
  color: #1E5AA8;
}

.page { display: none; }
.page.active { display: block; }

.page-title {
  font-size: 22px;
  margin-bottom: 24px;
  color: #1a1a1a;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header .page-title { margin-bottom: 0; }

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

/* 会员管理顶部紧凑费用卡 */
.fee-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.fee-card {
  position: relative;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  overflow: hidden;
}
.fee-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.fee-card.blue::before { background: #4a90e2; }
.fee-card.green::before { background: #34a86b; }
.fee-card.orange::before { background: #f0a030; }
.fee-card.purple::before { background: #9b6bd6; }
.fee-dot {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.fee-card.blue .fee-dot { background: #eef5fd; }
.fee-card.green .fee-dot { background: #ecf8f1; }
.fee-card.orange .fee-dot { background: #fdf4e6; }
.fee-card.purple .fee-dot { background: #f6effd; }
.fee-info { min-width: 0; }
.fee-num { font-size: 19px; font-weight: 700; color: #1a1a1a; line-height: 1.2; white-space: nowrap; }
.fee-label { font-size: 12px; color: #8a8f99; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1200px) { .fee-cards { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.stat-icon.blue { background: #e8f2fb; }
.stat-icon.green { background: #e8f8ef; }
.stat-icon.orange { background: #fff3e0; }
.stat-icon.purple { background: #f3e8ff; }

.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
}

.stat-label {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

/* 图表 */
.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.chart-card-header h3 { margin: 0; }
.chart-card-header select { padding: 4px 10px; border-radius: 6px; border: 1px solid #ddd; font-size: 13px; }
.chart-card-header input[type="date"], .chart-card-header input[type="month"] { padding: 4px 8px; border-radius: 6px; border: 1px solid #ddd; font-size: 13px; }

.chart-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.chart-card h3 {
  font-size: 16px;
  margin-bottom: 16px;
}

.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 表格卡片 */
.table-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h3 { font-size: 16px; }

.table-scroll {
  max-height: 500px;
  overflow-y: auto;
}

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

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 12px;
  background: #f8f9fa;
  font-weight: 600;
  font-size: 13px;
  color: #555;
  border-bottom: 2px solid #eee;
}

.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

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

.data-table img {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
}

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.status-active { background: #e8f8ef; color: #27ae60; }
.status-disabled { background: #f5f5f5; color: #999; }
.status-formal { background: #fff7e6; color: #fa8c16; }
.status-community { background: #e6f7ff; color: #1890ff; }

.level-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #1E5AA8;
  color: #fff;
  margin-right: 4px;
}

.category-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
}
.category-精读 { background: #e3f2fd; color: #1976d2; }
.category-深读 { background: #f3e5f5; color: #7b1fa2; }
.category-泛读 { background: #fff3e0; color: #f57c00; }
.status-trial { background: #e8f2fb; color: #1E5AA8; }
.status-teacher { background: #f3e8ff; color: #7c3aed; }
.status-reviewing { background: #fff7e6; color: #fa8c16; }
.status-completed { background: #e8f8ef; color: #27ae60; }
.status-rejected { background: #fff1f0; color: #e74c3c; }
.status-reading { background: #e6f7ff; color: #1890ff; }

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-bar select,
.filter-bar input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
}

.filter-bar input { flex: 1; max-width: 300px; }

/* 分段切换（财务周期） */
.seg-tabs { display: inline-flex; border: 1px solid #e3a85a; border-radius: 8px; overflow: hidden; }
.seg-tabs button { border: none; background: #fff; color: #b07a2e; padding: 7px 16px; font-size: 13px; cursor: pointer; }
.seg-tabs button + button { border-left: 1px solid #f0d9b5; }
.seg-tabs button.on { background: #f08a1e; color: #fff; }

/* 财务-支出类别下拉（保留原生三角） */
.fin-cat-select {
  border: 1px solid #f0c896;
  background: #FDF0E2;
  color: #C77B22;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  max-width: 132px;
  cursor: pointer;
}

/* Tab栏 */
.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
}

.tab {
  padding: 12px 24px;
  cursor: pointer;
  color: #666;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab.active {
  color: #1E5AA8;
  border-bottom-color: #1E5AA8;
  font-weight: 600;
}

.tab-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  border-radius: 9px;
  vertical-align: middle;
}

/* 区块卡片 */
.section-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.section-card h3 {
  font-size: 16px;
  margin-bottom: 20px;
}

/* 表单 */
.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: #555;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.form-group textarea { resize: vertical; }

/* 模态框 */
.modal-overlay {
  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-box {
  background: #fff;
  border-radius: 12px;
  width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 { font-size: 18px; }

.modal-close {
  cursor: pointer;
  font-size: 20px;
  color: #999;
  background: none;
  border: none;
}

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 操作按钮组 */
.action-btns {
  display: flex;
  gap: 8px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

/* 响应式 */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

.book-select-item {
  padding: 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
}
.book-select-item:hover {
  background: #f0f7ff;
}
.book-select-item.disabled {
  cursor: not-allowed;
  opacity: 0.6;
  display: flex;
  align-items: center;
}
.book-select-item.disabled:hover {
  background: transparent;
}


.grade-group-row {
  background: #f0f7ff !important;
}
.grade-group-row td {
  padding: 10px 15px !important;
  font-size: 15px;
  color: #1E5AA8;
  border-left: 3px solid #1E5AA8;
}

/* 销课金额汇总 */
.finance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.finance-card { padding: 12px 15px; border-radius: 8px; }
.finance-card.sold { background: #e8f5e9; }
.finance-card.unsold { background: #fff3e0; }
.finance-label { font-size: 13px; color: #666; margin-bottom: 4px; }
.finance-value { font-size: 16px; font-weight: 700; color: #333; }
.btn-sm { padding: 2px 8px; font-size: 12px; }
