/**
 * @Author: 林思齐 <lsq@moefire.net>
 * @Date: 2026-02-09 20:21:57
 * @LastEditors: 林思齐 <lsq@moefire.net>
 * @LastEditTime: 2026-02-09 20:38:34
 * @FilePath: src/main/webapp/assets/style.css
 * @Description: 
 */
/* 
  Theme: Academic Clean
  Vibe: Professional, Light, Crisp, Trustworthy
  Author: GitHub Copilot CLI
*/
:root {
  /* Color Palette - Light Mode */
  --bg-body: #f8fafc; /* Slate 50 */
  --bg-card: #ffffff;
  --bg-input: #f1f5f9; /* Slate 100 */
  
  --primary: #2563eb; /* Blue 600 - Classic Trust Blue */
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --text-main: #0f172a; /* Slate 900 */
  --text-muted: #64748b; /* Slate 500 */
  
  --border: #e2e8f0; /* Slate 200 */
  --border-focus: #2563eb;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --radius: 8px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: var(--font-sans);
  background-color: #e9ecef;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Typography */
h1, h2, h3 {
  color: var(--text-main);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.025em;
}

h1 {
  font-size: 1.875rem;
  margin-bottom: 0.5rem;
}

a { 
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

/* Layout */
.shell {
  width: 100%;
  max-width: 440px;
  padding: 2rem 1.5rem;
  margin: 0 auto;
}

.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: white;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.sub {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Card Component */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Top accent line on card */
.card::before {
  content: none; /* Removed for clean look */
}

/* Form Elements */
.field {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0.375rem;
}

input, select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s;
  outline: none;
}

input:focus, select:focus {
  background: white;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input::placeholder {
  color: #94a3b8;
}

/* Buttons */
.row {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  align-items: center;
}

.open-auth {
  text-align: center;
}

.open-auth-title {
  font-size: 1rem;
  font-weight: 650;
  margin-bottom: 1rem;
}

.open-auth-qr-frame {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.open-auth-qr-frame:hover,
.open-auth-qr-frame:focus-visible,
.open-auth-qr-frame.is-refreshable {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.open-auth-qr {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.open-auth [hidden] {
  display: none !important;
}

.open-auth-placeholder,
.open-auth-status {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.open-auth-status {
  min-height: 1.4rem;
  margin-top: 0.75rem;
}

.open-auth-refresh {
  margin-top: 0.75rem;
}

.login-shell {
  max-width: 470px;
}

.login-hero {
  margin-bottom: 1.5rem;
}

.login-card-simple {
  padding: 1.75rem 2rem;
}

.open-auth-onboarding {
  text-align: left;
}

.verified-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.4rem;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  background: #ecfdf5;
  color: #065f46;
}

.verified-identity strong {
  display: block;
  margin-bottom: 0.12rem;
  font-size: 0.9rem;
}

.verified-identity div div {
  font-size: 0.8rem;
  color: #37806c;
}

.verified-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: white;
  background: #10b981;
  font-weight: 700;
}

.identity-separator {
  margin: 0 0.35rem;
  opacity: 0.65;
}

.open-auth-onboarding h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.account-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 1.15rem;
  border-radius: 10px;
  background: #f1f5f9;
}

.account-choice-button {
  padding: 0.58rem 0.75rem;
  border: 0;
  border-radius: 7px;
  color: var(--text-muted);
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.account-choice-button.active {
  color: var(--primary);
  background: white;
  box-shadow: var(--shadow-sm);
}

.choice-pane .btn {
  width: 100%;
}

.open-auth-feedback {
  min-height: 1.35rem;
  margin-top: 0.8rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

.open-auth-feedback.ok { color: #047857; }
.open-auth-feedback.err { color: #b91c1c; }

.text-button {
  display: block;
  margin: 0.45rem auto 0;
  padding: 0.3rem;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.text-button:hover {
  color: var(--primary);
}

.legacy-login {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.legacy-login summary {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  cursor: pointer;
  list-style: none;
}

.legacy-login summary::-webkit-details-marker { display: none; }

.legacy-login[open] summary {
  margin-bottom: 1rem;
  color: var(--primary);
}

.legacy-login .btn {
  width: 100%;
}


.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--border);
}

.btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.25;
}

/* Utility: inline buttons inside toolbars/headers */
.btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  white-space: nowrap;
}

/* Utility: horizontal button group (supports <a> and <form><button>) */
.btn-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-group > * {
  flex: 0 0 auto;
}

.btn-group form {
  display: inline-flex;
}

@media (max-width: 640px) {
  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-group .btn-inline {
    width: 100%;
  }

  .btn-group form {
    width: 100%;
  }
}

/* Primary Button */
button.btn:not(.btn-ghost), 
a.btn:not(.btn-ghost) {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

button.btn:not(.btn-ghost):hover, 
a.btn:not(.btn-ghost):hover {
  background-color: var(--primary-hover);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

button.btn:not(.btn-ghost):active, 
a.btn:not(.btn-ghost):active {
  transform: translateY(0);
}

/* Ghost Button (Secondary) */
.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background-color: var(--bg-input);
  color: var(--primary-hover);
  text-decoration: none;
  border-color: #cbd5e1;
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert.ok {
  background-color: #ecfdf5; /* Emerald 50 */
  border-color: #a7f3d0;
  color: #047857;
}

.alert.err {
  background-color: #fef2f2; /* Red 50 */
  border-color: #fecaca;
  color: #b91c1c;
}

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1rem;
}

th {
  background-color: #f8fafc;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  background: white;
}

tr:last-child td {
  border-bottom: none;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag.warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.tag.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.tag.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Admin specific adjustments */
.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.actions select {
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  width: auto;
}

.actions .btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .shell { padding: 1rem; }
  h1 { font-size: 1.5rem; }
}
