:root {
  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --secondary: #ec4899;
  --background: #eef2ff;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  /* Neumorphism (soft UI) */
  --neu-bg: #eef2ff;
  --neu-surface: rgba(238, 242, 255, 0.85);
  --neu-surface-strong: rgba(255, 255, 255, 0.72);
  --neu-border: rgba(255, 255, 255, 0.55);
  --neu-shadow-out: 18px 18px 36px rgba(15, 23, 42, 0.10), -18px -18px 36px rgba(255, 255, 255, 0.85);
  --neu-shadow-in: inset 10px 10px 18px rgba(15, 23, 42, 0.10), inset -10px -10px 18px rgba(255, 255, 255, 0.85);
  --neu-shadow-out-sm: 10px 10px 18px rgba(15, 23, 42, 0.10), -10px -10px 18px rgba(255, 255, 255, 0.85);
  --neu-focus: 0 0 0 3px rgba(79, 70, 229, 0.16);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  background: radial-gradient(1200px 700px at 20% 15%, rgba(79, 70, 229, 0.16), transparent 60%),
              radial-gradient(900px 600px at 80% 90%, rgba(236, 72, 153, 0.12), transparent 60%),
              linear-gradient(145deg, #f6f8ff 0%, var(--neu-bg) 55%, #e9edff 100%);
  overflow-x: hidden;
}

a {
  color: inherit;
}

/* Background ornaments */
.bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.bg-pattern .circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.09);
  filter: blur(0.2px);
  animation: float 10s ease-in-out infinite;
}

.bg-pattern .circle:nth-child(1) {
  width: 160px;
  height: 160px;
  top: 8%;
  left: 12%;
  animation-delay: 0s;
}

.bg-pattern .circle:nth-child(2) {
  width: 220px;
  height: 220px;
  bottom: 10%;
  right: 10%;
  animation-delay: 1.5s;
  background: rgba(236, 72, 153, 0.08);
}

.bg-pattern .circle:nth-child(3) {
  width: 120px;
  height: 120px;
  top: 62%;
  left: 4%;
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(180deg); }
}

/* Top nav */
.top-nav {
  background: rgba(238, 242, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.logo-link:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

.logo-mark {
  fill: var(--primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  position: relative;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.45);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.55);
}

.nav-link.logout {
  color: var(--error);
}

.nav-link.logout:hover {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.10);
}

/* Layout */
.main-content {
  flex: 1;
  padding: 28px 16px 40px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.container.narrow {
  max-width: 820px;
}

.container.center {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 40px 0;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 20px;
}

/* Surfaces */
.card {
  background: var(--neu-surface-strong);
  border: 1px solid var(--neu-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--neu-shadow-out);
}

.card.pad-lg {
  padding: 40px;
}

.card.pad-md {
  padding: 28px 24px;
}

.card:hover {
  box-shadow: 22px 22px 44px rgba(15, 23, 42, 0.12), -22px -22px 44px rgba(255, 255, 255, 0.90);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: linear-gradient(145deg, rgba(79, 70, 229, 0.98), rgba(67, 56, 202, 0.98));
  color: white;
  box-shadow: 10px 10px 18px rgba(15, 23, 42, 0.16), -10px -10px 18px rgba(255, 255, 255, 0.80);
}

.btn-primary:hover {
  background: linear-gradient(145deg, rgba(67, 56, 202, 0.98), rgba(79, 70, 229, 0.98));
  transform: translateY(-1px);
  box-shadow: 14px 14px 24px rgba(15, 23, 42, 0.18), -14px -14px 24px rgba(255, 255, 255, 0.85);
}

.btn-soft {
  background: rgba(238, 242, 255, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.60);
  box-shadow: var(--neu-shadow-out-sm);
  color: var(--text-primary);
}

.btn-soft:hover {
  transform: translateY(-1px);
  box-shadow: 14px 14px 24px rgba(15, 23, 42, 0.14), -14px -14px 24px rgba(255, 255, 255, 0.88);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Shared neumorphic tiles (home/dashboard) */
.neu-tile {
  background: rgba(248, 250, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  padding: 16px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.neu-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.10);
}

.tile-k {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 800;
  margin-bottom: 6px;
}

.tile-v {
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.5px;
}

.tile-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Loading spinner (used by login.js) */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Forms */
.form {
  display: grid;
  gap: 16px;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-primary);
}

.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-sm);
  background: rgba(238, 242, 255, 0.75);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: var(--neu-shadow-in);
}

.input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--neu-shadow-in), var(--neu-focus);
}

.input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10);
}

.input.success {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.10);
}

.help-error {
  display: none;
  font-size: 12px;
  line-height: 1.4;
  color: var(--error);
}

.help-error.show {
  display: block;
  animation: fadeIn 0.25s ease;
}

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: var(--neu-shadow-out-sm);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.alert-danger {
  color: var(--error);
  background: #fef2f2;
  border: 1px solid #fee2e2;
}

.alert-success {
  color: var(--success);
  background: #ecfdf5;
  border: 1px solid #d1fae5;
}

/* Login / hero */
.hero {
  text-align: center;
}

.brand-badge {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: var(--neu-shadow-out-sm);
}

.brand-badge svg {
  width: 34px;
  height: 34px;
  fill: white;
}

.hero-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.6px;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 26px;
}

/* Utilities */
.muted {
  color: var(--text-secondary);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .nav-container { padding: 0 16px; }
  .logo-text { display: none; }
  .main-content { padding: 22px 14px 32px; }
  .page-title { font-size: 24px; }
  .card.pad-lg { padding: 28px 22px; }
  .hero-title { font-size: 28px; }
}

/* 弹窗公告样式 */
.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: 2000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: slideIn 0.3s ease;
}

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

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
  background: rgba(238, 242, 255, 0.80);
  color: var(--text-primary);
}

.modal-body {
  margin-bottom: 24px;
}

.modal-body p {
  margin-bottom: 12px;
  line-height: 1.6;
}

.modal-body ul {
  margin: 12px 0;
  padding-left: 24px;
}

.modal-body li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 85vh;
  }
}

@media (max-width: 480px) {
  .nav-menu { gap: 10px; }
  .nav-link { padding: 8px 9px; font-size: 13px; }
  .input { height: 44px; }
  .modal-content {
    width: 98%;
  }
}
