/* 聆界后台管理系统 - 样式表 */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif; background: #f0f2f5; }

/* 初始化页面 */
#initPage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* 登录页面 */
#loginPage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.login-box {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 400px;
}
.login-box h1 {
  text-align: center;
  color: #1e40af;
  margin-bottom: 8px;
  font-size: 28px;
}
.login-box p {
  text-align: center;
  color: #666;
  margin-bottom: 30px;
}
.login-box input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 16px;
  transition: border-color 0.3s;
}
.login-box input:focus {
  outline: none;
  border-color: #667eea;
}
.login-box button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}
.login-box button:hover {
  transform: translateY(-2px);
}
.login-box .error {
  background: #fee2e2;
  color: #dc2626;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: none;
}
.login-box .form-group {
  margin-bottom: 16px;
}
.login-box .form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}
.login-box .form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}
.login-box .form-group input:focus {
  outline: none;
  border-color: #667eea;
}

/* 主界面 */
#mainApp {
  display: none;
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 260px;
  background: #1e293b;
  color: white;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  transition: transform 0.3s;
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-header .logo {
  font-size: 32px;
}
.sidebar-header h1 {
  font-size: 20px;
  font-weight: 600;
}
.sidebar-header p {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}
.nav-menu {
  padding: 16px 0;
}
.nav-item {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
  color: #cbd5e1;
  text-decoration: none;
}
.nav-item:hover {
  background: #334155;
  color: white;
}
.nav-item.active {
  background: #667eea;
  color: white;
}
.nav-item .icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}
.nav-section {
  padding: 12px 20px 8px;
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* 主内容区 */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
}

/* 顶部栏 */
.topbar {
  background: white;
  padding: 16px 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}
.breadcrumb {
  color: #64748b;
  font-size: 14px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}
.user-name {
  font-weight: 500;
  color: #1e293b;
}
.logout-btn {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}
.logout-btn:hover {
  background: #fecaca;
}

/* 内容区 */
.content {
  padding: 32px;
}
.page-header {
  margin-bottom: 24px;
}
.page-header h2 {
  font-size: 24px;
  color: #1e293b;
  margin-bottom: 8px;
}
.page-header p {
  color: #64748b;
}

/* 卡片 */
.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.card h3 {
  font-size: 18px;
  color: #1e293b;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.stat-icon.blue { background: #dbeafe; }
.stat-icon.green { background: #dcfce7; }
.stat-icon.yellow { background: #fef3c7; }
.stat-icon.purple { background: #f3e8ff; }
.stat-info h4 {
  font-size: 28px;
  color: #1e293b;
  font-weight: 700;
}
.stat-info p {
  color: #64748b;
  font-size: 14px;
}

/* 表单 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #374151;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}
.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* 按钮 */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.btn-success {
  background: #059669;
  color: white;
}
.btn-danger {
  background: #dc2626;
  color: white;
}
.btn-secondary {
  background: #6b7280;
  color: white;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* 表格 */
.table-container {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}
th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
td {
  color: #1f2937;
}
tr:hover {
  background: #f9fafb;
}
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.status-pending {
  background: #fef3c7;
  color: #d97706;
}
.status-done {
  background: #dcfce7;
  color: #059669;
}

/* Tab 内容 */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* 响应式 */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .menu-toggle {
    display: block;
  }
  .topbar {
    padding: 16px;
  }
  .content {
    padding: 16px;
  }
}
