/* hink.uk 共享基础样式：黑白主题 + 通用组件 */

:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --fg-muted: #6b6b6b;
  --border: #e3e3e3;
  --bg-elevated: #f7f7f7;
  --bg-hover: #f0f0f0;
  --focus-ring: rgba(10, 10, 10, 0.35);
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --fg: #f5f5f5;
  --fg-muted: #9a9a9a;
  --border: #262626;
  --bg-elevated: #141414;
  --bg-hover: #1c1c1c;
  --focus-ring: rgba(245, 245, 245, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.15s ease, color 0.15s ease;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* 导航栏 */
.navbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.navbar .brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 700; font-size: 1.3rem;
}
.navbar .brand .icon { width: 32px; height: 32px; }
.navbar .links { display: flex; align-items: center; gap: 1.5rem; }
.navbar .links a { color: var(--fg-muted); transition: color 0.15s; }
.navbar .links a:hover, .navbar .links a.active { color: var(--fg); }
.navbar .spacer { flex: 1; }
.navbar .actions { display: flex; align-items: center; gap: 0.5rem; }

/* 图标按钮 */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px;
  color: var(--fg);
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn .icon { width: 20px; height: 20px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--bg-hover); }
.btn-primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-primary:hover { opacity: 0.85; background: var(--fg); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 语言下拉菜单 */
.lang-menu {
  position: relative;
}
.lang-menu .lang-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 130px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.lang-menu.open .lang-list { display: block; }
.lang-menu .lang-list button {
  display: flex; width: 100%; text-align: left;
  padding: 8px 12px; border-radius: 6px;
  color: var(--fg);
}
.lang-menu .lang-list button:hover { background: var(--bg-hover); }
.lang-menu .lang-list button[aria-selected="true"] { font-weight: 700; }

/* 卡片 */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

/* 表单 */
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.field label { font-size: 0.9rem; color: var(--fg-muted); }
.field input {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
.field input:focus { outline: 2px solid var(--fg); outline-offset: 0; }

.error-text { color: #d92d20; font-size: 0.9rem; min-height: 1.3em; }

/* 品牌 H 图标：三个矩形 + CSS 切角（右上 45°），避免 SVG clipPath id 冲突 */
.hink-icon {
  display: inline-block;
  color: currentColor;
  clip-path: polygon(0 0, 62.5% 0, 100% 37.5%, 100% 100%, 0 100%);
}
.hink-icon svg { display: block; width: 100%; height: 100%; fill: currentColor; }

/* 深浅色切换按钮：按主题显隐太阳/月亮图标 */
[data-theme-toggle] .icon-moon { display: none; }
[data-theme="dark"] [data-theme-toggle] .icon-moon { display: block; }
[data-theme="dark"] [data-theme-toggle] .icon-sun { display: none; }
