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

:root {
  --primary: #1b2b4b;
  --primary-light: #2d4a70;
  --gold: #b99b5c;
  --text-mid: #4a5f7c;
  --text-light: #7a8aa3;
  --success: #1f6e3f;
  --error: #b33a3a;
  --bg: #f0f4f9;
}

body {
  font-family: 'Inter', 'Noto Serif SC', sans-serif;
  background: var(--bg);
  color: #14263e;
}

.hidden { display: none !important; }

/* 登录页 */
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1b2b4b, #2d4a70);
  padding: 2rem;
}

.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
}

.login-card h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.login-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-card input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: 1.5px solid #dce4ed;
  border-radius: 14px;
  font-size: 1rem;
  margin-bottom: 1rem;
  outline: none;
  transition: all 0.2s;
}

.login-card input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(185, 155, 92, 0.12);
}

.btn-login {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(27, 43, 75, 0.3);
}

.login-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.8rem;
  min-height: 20px;
}

.back-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.85rem;
}

.back-link:hover { color: var(--primary); }

/* 管理界面布局 */
.admin-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #1b2b4b, #14213d);
  color: #fff;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0.5rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--gold), #dbbd7a);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #1b2b4b;
}

.sidebar-logo small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.6;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(185, 155, 92, 0.25), rgba(185, 155, 92, 0.1));
  color: var(--gold);
  border-left: 3px solid var(--gold);
}

.sidebar-back {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  transition: all 0.2s;
}

.sidebar-back:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-main {
  flex: 1;
  padding: 2rem 3rem;
  overflow-y: auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.admin-header h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.8rem;
  color: var(--primary);
}

.btn-logout {
  padding: 0.6rem 1.4rem;
  background: #fff;
  border: 1.5px solid #dce4ed;
  border-radius: 12px;
  color: var(--text-mid);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-logout:hover {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

/* 表单卡片 */
.form-card, .list-card {
  background: #fff;
  border-radius: 20px;
  padding: 2rem 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 20, 40, 0.06);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-mid);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: 1.5px solid #dce4ed;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  background: #fafdff;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(185, 155, 92, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  padding: 0.9rem 2rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(27, 43, 75, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-success, .form-error {
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.2rem;
  display: none;
}

.form-success {
  background: #edf7f0;
  color: var(--success);
  border: 1px solid #c8e6d0;
}

.form-error {
  background: #fff2f2;
  color: var(--error);
  border: 1px solid #f5d0d0;
}

.form-success.show, .form-error.show { display: block; }

/* 学员列表 */
.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e8eef5;
}

.list-toolbar span {
  font-weight: 600;
  color: var(--text-mid);
}

.btn-secondary {
  background: #fff;
  border: 1.5px solid #dce4ed;
  padding: 0.5rem 1.2rem;
  border-radius: 10px;
  color: var(--text-mid);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--primary);
}

.student-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.student-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.3rem;
  background: #fafdff;
  border: 1px solid #e8eef5;
  border-radius: 14px;
  transition: all 0.2s;
}

.student-item:hover {
  border-color: var(--gold);
  background: #fff;
}

.student-info .name {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.student-info .meta {
  font-size: 0.78rem;
  color: var(--text-light);
  font-family: 'Inter', monospace;
  line-height: 1.5;
}

.btn-delete {
  background: #fff2f2;
  color: var(--error);
  border: 1px solid #f5d0d0;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-delete:hover {
  background: var(--error);
  color: #fff;
}

.list-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}

@media (max-width: 800px) {
  .admin-container { flex-direction: column; }
  .sidebar { width: 100%; }
  .admin-main { padding: 1.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .form-card, .list-card { padding: 1.5rem; }
}