/* ==========================================
   Yard — 全局设计系统
   清爽 · 暖色 · 简洁
   ========================================== */

:root {
  /* 颜色 — 暖色清爽高对比度 */
  --bg:         #faf5ef;
  --surface:    #ffffff;
  --surface-hover: #fcf9f5;
  --text:       #000000;
  --text-muted: #444444;
  --border:     #e8ddd2;
  --accent:     #c4875a;
  --accent-hover: #b07346;
  --accent-light: #f5ede5;
  --danger:     #d4786a;

  /* 字体 */
  --font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --font-code:  "Consolas", "Courier New", "Source Code Pro", monospace;

  /* 圆角 */
  --radius:     10px;
  --radius-sm:  6px;

  /* 阴影 */
  --shadow:     0 2px 10px rgba(0, 0, 0, 0.07);
  --shadow-lg:  0 6px 24px rgba(0, 0, 0, 0.10);
}

/* ==========================================
   基础
   ========================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1, h2, h3, h4 {
  margin: 0 0 16px;
  font-weight: 600;
  color: var(--text);
}

h1 { font-size: 1.6em; }
h2 { font-size: 1.3em; }
h3 { font-size: 1.1em; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

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

/* 导航表格和按钮内的链接不显示下划线 */
table a, button a {
  text-decoration: none;
}
table a:hover, button a:hover {
  text-decoration: underline;
}

/* ==========================================
   卡片容器
   ========================================== */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  width: 100%;
  max-width: 720px;
  margin: 12px auto;
}

.card-wide {
  max-width: 960px;
}

/* ==========================================
   表格
   ========================================== */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

th {
  background: var(--accent-light);
  font-weight: 700;
  color: var(--accent-hover);
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

tr:nth-child(even) td {
  background: #fdfaf7;
}

tr:hover td {
  background: var(--surface-hover);
}

/* ==========================================
   按钮
   ========================================== */

button, .btn {
  display: inline-block;
  padding: 8px 20px;
  font-size: 0.95em;
  font-family: var(--font);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  line-height: 1.4;
}

button:hover, .btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

button:active {
  transform: scale(0.97);
}

button.btn-secondary {
  background: var(--border);
  color: var(--text);
}

button.btn-secondary:hover {
  background: #d5cdc5;
}

/* ==========================================
   输入框
   ========================================== */

input[type="text"],
input[type="password"],
input[type="file"],
select,
textarea {
  padding: 8px 12px;
  font-size: 0.95em;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.15);
}

/* ==========================================
   代码展示
   ========================================== */

.code-wrapper {
  width: 100%;
  max-width: 960px;
  margin: 12px auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.code-wrapper pre {
  margin: 0;
  padding: 20px;
  background: #fcfaf8;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.8;
}

.code-wrapper code {
  font-family: var(--font-code);
  font-size: 14px;
  font-weight: 500;
}

/* Prism 行号优化 */
.code-wrapper .line-numbers-rows {
  border-right: 1px solid var(--border);
  padding-right: 10px;
  margin-right: 14px;
}

.code-wrapper .line-numbers-rows > span:before {
  color: #c5b9ad;
}

/* ==========================================
   工具类
   ========================================== */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); font-size: 0.85em; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.flex-center { display: flex; justify-content: center; align-items: center; }
