/*
 * LittleLink 中文版 — 现代简约风
 * 纯静态、无框架、无构建。基于 LittleLink v3.11.0 二开，MIT 协议。
 */

/* ---------- 基础 ---------- */
:root {
  --bg: #F7F7F4;
  --card: #FFFFFF;
  --border: #E8E8E1;
  --ink: #1B1B18;
  --muted: #71716A;
  --accent: #0F766E;
  --accent-soft: #E6F2F0;
  --shadow: 0 1px 2px rgba(20, 20, 16, 0.05);
  --radius-lg: 18px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 20px 0;
  box-sizing: border-box;
  text-align: center;
}

/* ---------- 头部 ---------- */
.avatar {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  object-fit: cover;
  display: block;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.22);
}

h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.bio {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}

.meta {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--muted);
}

.dot {
  margin: 0 6px;
  color: var(--border);
}

/* ---------- 搜索框 ---------- */
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 14px;
  margin-bottom: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  box-sizing: border-box;
  color: var(--muted);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon {
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  padding: 0;
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-box input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

#search-clear {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- 链接列表 ---------- */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 8px 16px 8px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  box-sizing: border-box;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.link-btn:hover {
  transform: translateY(-1px);
  border-color: #D8D8D0;
  box-shadow: 0 6px 20px rgba(20, 20, 16, 0.08);
}

.link-btn:active {
  transform: scale(0.99);
}

.chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--chip-bg, #F0F0EC);
}

.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.link-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.link-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-sub {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arrow {
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
  color: #C9C9C1;
}

/* ---------- 空状态 / 页脚 ---------- */
.empty-state {
  margin: 24px 0 0;
  font-size: 14px;
  color: var(--muted);
}

footer {
  margin: 40px 0 32px;
  font-size: 13px;
  color: var(--muted);
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

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

/* ---------- 隐私页 ---------- */
.container-left {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 0;
  box-sizing: border-box;
  text-align: left;
}

.container-left nav {
  margin-bottom: 24px;
  font-size: 14px;
}

.container-left nav a {
  color: var(--muted);
  text-decoration: none;
}

.container-left nav a:hover {
  color: var(--accent);
}

.container-left h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

.container-left h2 {
  font-size: 18px;
  margin: 32px 0 8px;
}

.container-left p {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--muted);
}

.container-left ul {
  margin: 0 0 12px;
  padding-left: 20px;
  font-size: 15px;
  color: var(--muted);
}

.container-left ul li {
  margin-bottom: 6px;
}

.container-left footer {
  text-align: center;
}

/* ---------- 深色模式 ---------- */
:root.theme-dark {
  color-scheme: dark;
  --bg: #131313;
  --card: #1E1E1E;
  --border: #2C2C2C;
  --ink: #F2F2F0;
  --muted: #A3A3A0;
  --accent: #2DD4BF;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

:root.theme-dark .link-btn:hover {
  border-color: #3D3D3D;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

:root.theme-dark .arrow {
  color: #555550;
}

:root.theme-dark .avatar {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root.theme-auto {
    color-scheme: dark;
    --bg: #131313;
    --card: #1E1E1E;
    --border: #2C2C2C;
    --ink: #F2F2F0;
    --muted: #A3A3A0;
    --accent: #2DD4BF;
    --accent-soft: rgba(45, 212, 191, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
  :root.theme-auto .link-btn:hover {
    border-color: #3D3D3D;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  }
  :root.theme-auto .arrow {
    color: #555550;
  }
  :root.theme-auto .avatar {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }
}

/* ---------- 小屏收紧 ---------- */
@media (max-width: 380px) {
  .container {
    padding: 36px 16px 0;
  }
  .avatar {
    width: 88px;
    height: 88px;
  }
  h1 {
    font-size: 22px;
  }
}

/* ---------- 占位链接（待开通） ---------- */
.link-btn.is-placeholder {
  opacity: 0.78;
  cursor: default;
}

.link-btn.is-placeholder:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.tag-todo {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- 联系方式卡片 ---------- */
.contact-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  box-sizing: border-box;
  padding: 4px 16px 10px;
  margin-bottom: 20px;
}

.contact-card h2 {
  margin: 12px 0 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
}

.contact-row + .contact-row {
  border-top: 1px solid var(--border);
}

.contact-label {
  flex-shrink: 0;
  width: 36px;
  font-size: 13px;
  color: var(--muted);
}

.contact-value {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-btn {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
}

.copy-btn:active {
  transform: scale(0.96);
}

/* ---------- 底部提示条 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(8px);
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
