:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --accent-color: #4cc9f0;
  --success-color: #4ade80;
  --background-dark: #0f172a;
  --background-light: #f8fafc;
  --surface-dark: rgba(30, 41, 59, 0.7);
  --surface-light: rgba(255, 255, 255, 0.8);
  --text-dark: #f1f5f9;
  --text-light: #1e293b;
  --text-muted-dark: #94a3b8;
  --text-muted-light: #64748b;
  --border-dark: rgba(255, 255, 255, 0.1);
  --border-light: rgba(0, 0, 0, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: light) {
  body {
    --bg-color: var(--background-light);
    --surface-color: var(--surface-light);
    --text-color: var(--text-light);
    --text-muted: var(--text-muted-light);
    --border-color: var(--border-light);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
  }
}

@media (prefers-color-scheme: dark) {
  body {
    --bg-color: var(--background-dark);
    --surface-color: var(--surface-dark);
    --text-color: var(--text-dark);
    --text-muted: var(--text-muted-dark);
    --border-color: var(--border-dark);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
    radial-gradient(at 50% 0%, hsla(225,39%,30%,0.2) 0, transparent 50%), 
    radial-gradient(at 100% 0%, hsla(339,49%,30%,0.2) 0, transparent 50%);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background-color 0.3s ease;
}

@media (prefers-color-scheme: light) {
  body {
    background-image: 
      radial-gradient(at 0% 0%, hsla(210,100%,98%,1) 0, transparent 50%), 
      radial-gradient(at 50% 0%, hsla(225,100%,94%,1) 0, transparent 50%), 
      radial-gradient(at 100% 0%, hsla(339,100%,96%,1) 0, transparent 50%);
  }
}

.container {
  width: 90%;
  max-width: 1000px;
  margin: 40px auto;
  padding: 30px;
  background: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

header {
  text-align: center;
  margin-bottom: 40px;
}

h1 {
  font-weight: 800;
  font-size: 2.5rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

.tab-btn.active {
  color: var(--primary-color);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-color);
  border-radius: 3px 3px 0 0;
}

/* Table */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 10px;
}

th, td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th.group-th {
  text-align: center;
  border-bottom: 2px solid var(--primary-color);
  background: rgba(255, 255, 255, 0.05);
}

th.date-col {
  text-align: center;
  padding: 12px 8px;
}

th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

tr {
  transition: background-color 0.2s ease;
}

tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

td.name-col {
  font-weight: 600;
  display: flex;
  flex-direction: column;
}

td.name-col span.pinyin {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 4px;
}

/* Checkboxes */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-wrapper input[type="checkbox"] {
  appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 16px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.checkbox-wrapper input[type="checkbox"]:hover {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

/* Stats Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card h3 {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 10px;
}

.stat-card .value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-color);
}

/* Login Form */
.login-container {
  max-width: 400px;
  margin: 100px auto;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.btn {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--success-color);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background: #ef4444;
}

/* Utilities */
.hidden {
  display: none !important;
}
