@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Inter:wght@400;600;800&display=swap');

:root {
  /* --- Liquid Glass 核心變數 --- */
  --bg0: #05080f;
  --glass-surf: rgba(20, 25, 40, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.12);
  
  --ink: #eef4ff;
  --muted: rgba(238, 244, 255, 0.65);
  
  --accent: #00a3ff;
  --accent-glow: rgba(0, 163, 255, 0.4);
  --accent2: #0066ff;
  
  --success: #00ff9d;
  --warning: #ffcc00;
  --danger: #ff4d6d;
  
  --radius: 20px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  
  --font-mono: 'Share Tech Mono', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--font-sans);
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#bg { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(circle at 50% 50%, transparent 20%, #05080f 90%);
  pointer-events: none;
}

/* === 頂部導航 === */
.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(5, 8, 15, 0.3);
  backdrop-filter: blur(12px);
  z-index: 100;
  flex-shrink: 0;
}

.logo {
  font-family: var(--font-mono); font-size: 1.2rem; font-weight: 700;
  color: var(--ink); text-shadow: 0 0 15px var(--accent-glow); letter-spacing: 1px;
}
.userinfo {
  font-size: 0.85rem; color: var(--muted); font-family: var(--font-mono);
  padding: 4px 12px; background: var(--glass-border); border-radius: 50px;
}

/* === 主佈局 === */
.wrapper { flex: 1; display: flex; overflow: hidden; position: relative; }

/* === 側邊欄 === */
.sidebar {
  width: 240px; padding: 20px; display: flex; flex-direction: column; gap: 10px;
  border-right: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  flex-shrink: 0;
}

.tab-btn {
  padding: 12px 16px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--muted); font-size: 0.9rem; font-weight: 600;
  text-align: left; cursor: pointer; transition: all 0.3s ease;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.03); }
.tab-btn.active {
  background: rgba(0, 163, 255, 0.1); border-color: rgba(0, 163, 255, 0.3);
  color: #fff; box-shadow: 0 0 20px var(--accent-glow);
}

/* === 內容區 === */
.content { flex: 1; padding: 30px; overflow-y: auto; overflow-x: hidden; position: relative; }

.spark {
  font-size: 1.8rem; font-weight: 800; margin: 0 0 20px 0;
  background: linear-gradient(120deg, #fff, var(--accent), #fff);
  background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: shine 4s linear infinite; display: inline-block;
}
@keyframes shine { to { background-position: 200% center; } }

.actions { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
input[type="text"], input[type="number"], input[type="password"], input[type="email"] {
  background: rgba(0, 0, 0, 0.4); border: 1px solid var(--glass-border);
  padding: 10px 14px; border-radius: 10px; color: var(--ink); font-size: 0.9rem;
  transition: 0.3s; flex: 1; min-width: 200px;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }

/* === 玻璃表格 === */
.table-wrap {
  background: var(--glass-surf); border: 1px solid var(--glass-border);
  border-radius: var(--radius); overflow-x: auto; /* 讓表格在手機上可以橫向滑動 */
  box-shadow: var(--shadow); backdrop-filter: blur(20px);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th {
  background: rgba(255, 255, 255, 0.03); padding: 16px; text-align: left;
  font-size: 0.8rem; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--glass-border);
}
td {
  padding: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--ink); font-size: 0.9rem; vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* 創作者頭貼小圖 */
.avatar-sm {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--glass-border); vertical-align: middle;
}

/* === 按鈕樣式 === */
button {
  padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 0.85rem;
  cursor: pointer; border: none; transition: all 0.25s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff; box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px var(--accent-glow); }
.btn-ghost {
  background: rgba(255,255,255,0.05); color: var(--ink); border: 1px solid transparent;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2);
}
td button { padding: 4px 10px; font-size: 0.75rem; margin-right: 4px; }

/* === 狀態標籤 === */
.status-tag {
  padding: 4px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.status-tag.WAIT_ADMIN { background: rgba(255, 204, 0, 0.15); color: #ffcc00; border: 1px solid rgba(255, 204, 0, 0.3); }
.status-tag.CONFIRMED, .status-tag.PUBLISHED { background: rgba(0, 255, 157, 0.15); color: #00ff9d; border: 1px solid rgba(0, 255, 157, 0.3); }
.status-tag.CANCELLED, .status-tag.REJECTED, .status-tag.DRAFT { background: rgba(255, 77, 109, 0.15); color: #ff4d6d; border: 1px solid rgba(255, 77, 109, 0.3); }

/* === 彈窗 === */
.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; transition: opacity 0.3s; padding: 20px;
}
.modal.show { display: flex; opacity: 1; }
.modal-content {
  background: rgba(20, 25, 40, 0.85); border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px; padding: 24px; width: 100%; max-width: 420px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.6);
  transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal.show .modal-content { transform: scale(1); }
.modal h3 { margin-top: 0; font-size: 1.3rem; margin-bottom: 16px; color: #fff; }
.modal input { margin-bottom: 12px; background: rgba(0,0,0,0.3); }
.modal-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }

.page { display: none; animation: fadeIn 0.4s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 通知 */
.notify {
  position: fixed; bottom: 20px; right: 20px; left: 20px;
  background: rgba(15, 20, 30, 0.9); border: 1px solid var(--glass-border);
  color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5); backdrop-filter: blur(10px);
  z-index: 9999; border-left: 4px solid var(--accent);
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-align: center;
}
.notify.error { border-left-color: var(--danger); }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* =========================================
   📱 手機版適配 (Responsive Design)
========================================= */
@media (max-width: 768px) {
  .topbar { padding: 0 16px; }
  .logo { font-size: 1rem; }
  
  /* 主佈局改為垂直排列 */
  .wrapper { flex-direction: column; }
  
  /* 側邊欄變為頂部橫向滑動選單 */
  .sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding: 10px 16px;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    gap: 8px;
    -webkit-overflow-scrolling: touch; /* 讓 iOS 滑動更順 */
  }
  /* 隱藏滾動條但保留功能 */
  .sidebar::-webkit-scrollbar { display: none; }
  .tab-btn { padding: 8px 12px; font-size: 0.85rem; }

  /* 內容區調整 */
  .content { padding: 20px 16px; }
  .spark { font-size: 1.5rem; margin-bottom: 16px; }
  
  /* 操作列輸入框滿寬 */
  .actions input { min-width: 100%; }
  
  /* 表格內邊距縮小 */
  th, td { padding: 12px; }
}