/* 主題色彩變數 */
:root {
  --bg-page: #e8ecf0;
  --bg-card: #f4f6f8;
  --bg-header: #d4dce4;
  --text-main: #2c3e50;
  --text-muted: #5a6b7d;
  --border: #b8c4ce;
  --accent: #4a6fa5;
  --accent-hover: #3d5f8f;
  --error: #a94442;
}

/* 全頁基礎樣式 */
body {
  font-family: "jf-openhuninn", "Noto Sans TC", sans-serif;
  line-height: 1.6;
  background-color: var(--bg-page);
  color: var(--text-main);
  padding: 0 16px;
}

/* 登入頁版面 */
body.login-page {
  max-width: 600px;
  margin: 80px auto;
}

/* 管理後台版面 */
body.admin-page {
  max-width: 1000px;
  margin: 40px auto;
}

/* 標題與內文 */
h1 {
  color: var(--text-main);
  font-weight: 600;
}

p {
  color: var(--text-muted);
}

code {
  background: var(--bg-header);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* 表單元件共用 */
input,
button,
select {
  padding: 10px 14px;
  font-size: 16px;
  font-family: inherit;
  margin-top: 8px;
}

/* 密碼輸入與下拉選單 */
input[type="password"],
select {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
}

input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.15);
}

/* 按鈕 */
button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: var(--accent-hover);
}

/* 卡片容器 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
}

.card h1 {
  margin-bottom: 8px;
}

/* 錯誤訊息 */
.error {
  color: var(--error);
  background: rgba(169, 68, 66, 0.08);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--error);
}

/* 資料表格 */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

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

th:last-child,
td:last-child {
  border-right: none;
}

tbody tr:last-child td {
  border-bottom: none;
}

th {
  background: var(--bg-header);
  color: var(--text-main);
  font-weight: 500;
}

/* 表格斑馬紋與 hover */
tbody tr:nth-child(even) {  /* 偶數行 */
  background: rgba(212, 220, 228, 0.3);
}

tbody tr:hover {
  background: rgba(74, 111, 165, 0.06);
}

/* 連結 */
a {
  color: var(--accent);
  text-decoration: none;
  font-size: 15px;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.action-cell {
  white-space: nowrap;
}

.predict-btn {
  margin-left: 12px;
  padding: 6px 12px;
}

.predict-result {
  min-width: 6em;
}

button {
  font-size: 15px;
}

/* 頂部導覽列 */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.top-bar h1 {
  margin: 0;
}
