@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Share+Tech+Mono&family=Noto+Sans+TC:wght@400;500;700;900&display=swap');

:root {
  --void: #05070f;
  --void-2: #070c1a;
  --panel: #0c1730;
  --panel-2: #101f3d;
  --panel-border: #1e3a63;
  --grid-line: rgba(56, 189, 248, 0.06);
  --cyan: #2ee6ff;
  --cyan-dim: #0b8fb0;
  --cyan-glow: rgba(46, 230, 255, 0.35);
  --purple: #b06bff;
  --purple-glow: rgba(176, 107, 255, 0.3);
  --white: #eaf4ff;
  --text: #cfe0f5;
  --muted: #7288a8;
  --border: #1e3a63;
  --amber: #ffcc33;
  --amber-bg: rgba(255, 204, 51, 0.12);
  --green: #39ff9c;
  --green-bg: rgba(57, 255, 156, 0.12);
  --red: #ff4d6d;
  --red-bg: rgba(255, 77, 109, 0.12);
}

* { box-sizing: border-box; }

html { background: var(--void); }

body {
  margin: 0;
  font-family: 'Noto Sans TC', 'Orbitron', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  background: var(--void);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  position: relative;
}

/* ---------- ambient sci-fi backdrop ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 900px 500px at 12% -5%, rgba(46, 230, 255, 0.14), transparent 60%),
    radial-gradient(ellipse 800px 600px at 100% 10%, rgba(176, 107, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 700px 500px at 50% 110%, rgba(46, 230, 255, 0.08), transparent 55%),
    linear-gradient(180deg, var(--void) 0%, var(--void-2) 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 40%, transparent 90%);
}

header.site-header {
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  color: var(--white);
  padding: 1rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--panel-border);
  box-shadow: 0 1px 0 rgba(46, 230, 255, 0.25), 0 8px 24px rgba(0, 0, 0, 0.4);
  position: sticky;
  top: 0;
  z-index: 50;
}

header.site-header .brand {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan-glow);
  white-space: nowrap;
  flex-shrink: 0;
}

header.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.35rem;
}

header.site-header nav a,
header.site-header nav button {
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

header.site-header nav a:hover,
header.site-header nav button:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  text-decoration: none;
}

header.site-header .user-tag {
  color: var(--muted);
  font-size: 0.8rem;
  margin-right: 0.5rem;
  letter-spacing: 0.02em;
}

header.site-header .user-tag .role-chip {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.5rem;
  border-radius: 2px;
  font-size: 0.68rem;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--cyan-dim);
  color: var(--cyan);
  background: rgba(46, 230, 255, 0.08);
  vertical-align: middle;
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.75rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 4.5rem;
  background:
    radial-gradient(ellipse 700px 300px at 50% 0%, rgba(46, 230, 255, 0.12), transparent 65%),
    linear-gradient(180deg, var(--panel-2) 0%, var(--void-2) 100%);
  border-bottom: 1px solid var(--panel-border);
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 4.4vw, 2.6rem);
  letter-spacing: 0.04em;
  margin-bottom: 0.9rem;
  color: var(--white);
  text-shadow: 0 0 22px var(--cyan-glow), 0 0 4px rgba(255, 255, 255, 0.4);
  animation: title-glow 3.5s ease-in-out infinite;
}

@keyframes title-glow {
  0%, 100% { text-shadow: 0 0 18px var(--cyan-glow), 0 0 4px rgba(255,255,255,0.3); }
  50% { text-shadow: 0 0 32px var(--cyan-glow), 0 0 10px rgba(255,255,255,0.5); }
}

.hero p {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 620px;
  margin: 0 auto 2rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  padding: 0.65rem 1.6rem;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 0 0 rgba(46, 230, 255, 0);
}

.btn:hover {
  color: var(--void);
  background: var(--cyan);
  box-shadow: 0 0 22px var(--cyan-glow);
  border-color: var(--cyan);
}

.btn-primary {
  background: var(--cyan);
  color: var(--void);
  border-color: var(--cyan);
  box-shadow: 0 0 16px var(--cyan-glow);
}

.btn-primary:hover {
  background: var(--white);
  border-color: var(--white);
  box-shadow: 0 0 24px var(--cyan-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--purple);
  border: 1px solid var(--purple);
}

.btn-secondary:hover {
  background: var(--purple);
  color: var(--void);
  box-shadow: 0 0 22px var(--purple-glow);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}

.btn-danger:hover {
  background: var(--red);
  color: var(--void);
  box-shadow: 0 0 20px rgba(255, 77, 109, 0.4);
}

/* ---------- section title ---------- */
.section-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--white);
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 0.6rem;
  margin-bottom: 1.4rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  position: relative;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
  margin-right: 0.6rem;
  transform: rotate(45deg);
  vertical-align: middle;
}

/* ---------- cards ---------- */
.card {
  background: linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--panel-border);
  border-radius: 2px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1rem;
  position: relative;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-top: 2px solid var(--cyan-dim);
  border-left: 2px solid var(--cyan-dim);
  top: -1px;
  left: -1px;
  opacity: 0.7;
  transition: border-color 0.18s ease;
}

.card::after {
  top: auto;
  left: auto;
  bottom: -1px;
  right: -1px;
  border-top: none;
  border-left: none;
  border-bottom: 2px solid var(--cyan-dim);
  border-right: 2px solid var(--cyan-dim);
}

.card:hover {
  border-color: var(--cyan-dim);
  box-shadow: 0 8px 30px rgba(46, 230, 255, 0.08);
  transform: translateY(-2px);
}

.card:hover::before,
.card:hover::after {
  border-color: var(--cyan);
}

.card h3 {
  margin: 0 0 0.5rem;
  color: var(--white);
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.card a {
  color: var(--cyan);
}

.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-grid .card {
  text-align: center;
}

.feature-grid .card h3::before {
  content: "";
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 0.85rem;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  box-shadow: 0 0 18px var(--cyan-glow);
}

/* ---------- forms ---------- */
form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 420px;
}

form.wide { max-width: 640px; }

.inline-form {
  flex-direction: row;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

label {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

input, textarea, select {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 0.98rem;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--void-2);
  color: var(--white);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder, textarea::placeholder { color: #4a5f80; }

input:focus, textarea:focus, select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(46, 230, 255, 0.15);
}

textarea { min-height: 100px; resize: vertical; }

.auth-box {
  max-width: 420px;
  margin: 3rem auto;
  background: linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--panel-border);
  border-radius: 2px;
  padding: 2.2rem 2rem;
  box-shadow: 0 0 40px rgba(46, 230, 255, 0.06), 0 20px 50px rgba(0,0,0,0.4);
  position: relative;
}

.auth-box::before,
.auth-box::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-top: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
  top: -1px;
  left: -1px;
}

.auth-box::after {
  top: auto;
  left: auto;
  bottom: -1px;
  right: -1px;
  border-top: none;
  border-left: none;
  border-bottom: 2px solid var(--cyan);
  border-right: 2px solid var(--cyan);
}

.auth-box h1 {
  font-family: 'Orbitron', sans-serif;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1.25rem;
  margin-top: 0;
  text-shadow: 0 0 14px var(--cyan-glow);
}

/* ---------- status badges ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.7rem;
  border-radius: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

.status-pending { background: var(--amber-bg); color: var(--amber); }
.status-approved { background: var(--green-bg); color: var(--green); }
.status-rejected { background: var(--red-bg); color: var(--red); }

.error-text {
  color: var(--red);
  font-size: 0.85rem;
  min-height: 1.2em;
}

.success-text {
  color: var(--green);
  font-size: 0.85rem;
}

.muted { color: var(--muted); font-size: 0.9rem; }

.link-row {
  margin-top: 1.2rem;
  font-size: 0.85rem;
}

.link-row a { color: var(--cyan); }

/* ---------- tables ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--panel-border);
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: var(--panel);
  font-size: 0.9rem;
}

table th, table td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--panel-border);
  font-size: 0.86rem;
  white-space: nowrap;
}

table td.wrap {
  white-space: normal;
  min-width: 220px;
}

table th {
  background: var(--panel-2);
  color: var(--cyan);
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

table tbody tr {
  transition: background 0.15s ease;
}

table tbody tr:hover {
  background: rgba(46, 230, 255, 0.04);
}

.row-actions button {
  margin-right: 0.5rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.7rem;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.04em;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--panel-border);
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  .card-list { grid-template-columns: 1fr; }
  .hero { padding: 3.5rem 1.25rem 3rem; }
  .inline-form { flex-direction: column; align-items: stretch; }
}
