/*
 * V2EX Claude | 非官方 Anthropic 风格主题
 * 参考：https://github.com/anthropics/skills/tree/main/skills/brand-guidelines
 * 将本文件作为唯一的 V2EX 自定义主题使用，不要与 Geist 叠加。
 * 字体由 Google Fonts 提供，加载失败时使用系统字体。
 */

@font-face {
  font-family: "V2EX Poppins";
  src: url("https://fonts.gstatic.com/s/poppins/v24/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "V2EX Poppins";
  src: url("https://fonts.gstatic.com/s/poppins/v24/pxiByp8kv8JHgFVrLEj6Z1xlFd2JQEk.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "V2EX Lora";
  src: url("https://fonts.gstatic.com/s/lora/v37/0QIvMX1D_JOuMwr7I_FMl_E.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* 纸面、墨色与陶橙：强调交互状态，不把帖子正文染成品牌色。 */
:root:root {
  color-scheme: light dark;
  --vc-ui: "V2EX Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --vc-reading: "V2EX Lora", Georgia, "Songti SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  --vc-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --vc-canvas: light-dark(#faf9f5, #141413);
  --vc-sheet: light-dark(#fffefa, #1e1d1a);
  --vc-fill: light-dark(#f3f0e8, #282621);
  --vc-hover: light-dark(#eeeadf, #312d27);
  --vc-line: light-dark(#e8e6dc, #37342d);
  --vc-control: light-dark(#8e877a, #82796b);
  --vc-ink: light-dark(#141413, #faf9f5);
  --vc-muted: light-dark(#625e55, #b0aea5);
  --vc-clay: light-dark(#973f28, #f0a88e);
  --vc-clay-tint: light-dark(#f7e7dd, #3a2820);
  --vc-action: light-dark(#973f28, #d97757);
  --vc-action-hover: light-dark(#7b321f, #e68f73);
  --vc-on-action: light-dark(#fffefa, #141413);
  --vc-radius: 14px;
  --vc-pad: 20px;
  --vc-gutter: clamp(14px, 3vw, 28px);
  --vc-logo-filter: brightness(0) invert(.08);

  /* 让站内现有菜单、弹窗和编辑组件继承主题。 */
  --code-font: var(--vc-mono);
  --box-background-color: var(--vc-sheet);
  --box-background-translucent-color: var(--vc-sheet);
  --box-glass-color: var(--vc-sheet);
  --box-thick-glass-color: var(--vc-sheet);
  --box-background-alt-color: var(--vc-fill);
  --box-background-hover-color: var(--vc-hover);
  --box-foreground-color: var(--vc-ink);
  --box-border-color: var(--vc-line);
  --box-border-hover-color: var(--vc-control);
  --box-border-focus-color: var(--vc-clay);
  --box-border-radius: 8px;
  --button-background-color: var(--vc-sheet);
  --button-background-hover-color: var(--vc-fill);
  --button-background-active-color: var(--vc-hover);
  --button-foreground-color: var(--vc-ink);
  --button-foreground-hover-color: var(--vc-ink);
  --button-border-color: var(--vc-control);
  --button-border-hover-color: var(--vc-clay);
  --node-sidebar-hover-color: var(--vc-fill);
  --color-foreground: var(--vc-ink);
  --color-graphite: var(--vc-ink);
  --color-gray: var(--vc-muted);
  --color-fade: var(--vc-muted);
  --link-color: var(--vc-muted);
  --link-visited-color: var(--vc-muted);
  --link-hover-color: var(--vc-ink);
  --link-primary-color: var(--vc-clay);
}

:root[data-site-theme="light"] { color-scheme: light; }
:root[data-site-theme="dark"],
:root:not([data-site-theme]):has(#Wrapper.Night) {
  color-scheme: dark;
  --vc-logo-filter: brightness(0) invert(.96);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-site-theme="light"]) { --vc-logo-filter: brightness(0) invert(.96); }
}

html, body { background: var(--vc-canvas); color: var(--vc-ink); }
body { min-width: 0 !important; font-family: var(--vc-ui) !important; }
#Wrapper, #Wrapper.Night {
  /* 节点可以在页面下方另外注入背景样式。 */
  background: var(--vc-canvas) !important;
  color: var(--vc-ink);
}

:is(#Top, #Wrapper, #Bottom) > .content {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--vc-gutter);
}
#Wrapper > .content::after { content: ""; display: block; clear: both; }
#Main { margin-inline: 0 290px; }
#Rightbar { width: 266px; margin-inline: 0; }

#Top, #site-header, #Bottom {
  box-sizing: border-box;
  background: var(--vc-canvas);
  border-color: var(--vc-line);
  color: var(--vc-muted);
  box-shadow: none;
}
#Top { height: 64px; padding-inline: 0; }
#Top .site-nav { min-height: 63px; padding-top: 0; }
#Bottom { padding-inline: 0; }
#Logo, #LogoMobile { filter: var(--vc-logo-filter); }
:is(#Top, #site-header) a.top:any-link { color: var(--vc-ink); }

:is(#Top, #site-header) #search-container {
  box-sizing: border-box;
  min-width: 0;
  height: 34px;
  margin-block: 0;
  background: var(--vc-sheet);
  border: 1px solid var(--vc-control);
  border-radius: 9px;
}
:is(#Top, #site-header) #search-container::before {
  top: 0;
  filter: var(--vc-logo-filter) opacity(.66);
  pointer-events: none;
}
#search-container #search { color: var(--vc-ink); font: 400 16px/1 var(--vc-ui); }
#search-container #search-result {
  top: calc(100% + 6px);
  color: var(--vc-ink);
  box-shadow: none;
}
#search-container #search-result .search-item { color: var(--vc-muted); }

#Wrapper .box, #Top .box, #site-header .box {
  background: var(--vc-sheet);
  color: var(--vc-ink);
  border: 1px solid var(--vc-line) !important;
  border-radius: var(--vc-radius);
  box-shadow: none;
}
#Wrapper .box:empty,
#Wrapper #pro-campaign-container:not(:has(> *)) { border: 0 !important; }
/* 回复连接线依赖站点原生的行内边距。 */
#Wrapper .box > :is(.cell, .inner, .header, .subtle):where(:not(
  .reply-threads-d > .cell[data-depth],
  .reply-threads-f.reply-lines-on > .cell[data-reply-id]
)) {
  padding: 13px var(--vc-pad);
  border-bottom-color: var(--vc-line);
}
#Wrapper .box > :is(.cell, .inner, .header, .subtle):last-child { border-bottom: 0; }
#Rightbar .box > :is(.cell, .inner, .header) { padding: 12px 15px; }
#Wrapper a.balance_area:any-link {
  border: 1px solid var(--vc-line);
  border-radius: 7px;
  background: var(--vc-fill);
  color: var(--vc-ink);
  font-variant-numeric: tabular-nums;
  text-shadow: none;
}
#Wrapper a.balance_area:hover {
  border-color: var(--vc-control);
  background: var(--vc-hover);
}
#Wrapper a.balance_area:active { background: var(--vc-clay-tint); }
#Rightbar .box:has(a.super.button[href="/signup"]) { background: var(--vc-fill); }
#Rightbar .box:has(a.super.button[href="/signup"]) > .cell > strong {
  font: 600 16px/1.45 var(--vc-reading);
}

/* 设置页：沿用纸面与陶色，保留原生控件和 Select2 的交互。 */
#Wrapper :is(a.tab, a.tab_current)[href^="/settings/"] {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 2px 3px 2px 0;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--vc-muted);
  font: 500 13px/1.2 var(--vc-ui);
}
#Wrapper a.tab[href^="/settings/"]:hover { background: var(--vc-fill); color: var(--vc-ink); }
#Wrapper a.tab_current[href^="/settings/"] {
  background: var(--vc-clay-tint);
  color: var(--vc-clay);
  font-weight: 600;
}
#Wrapper form[action="/settings"] .onoffswitch input {
  display: block;
  position: absolute;
  opacity: 0;
}
#Wrapper form[action="/settings"] .onoffswitch input:focus-visible + label {
  outline: 2px solid var(--vc-clay);
  outline-offset: 2px;
}
#Wrapper form[action="/settings"] .onoffswitch label { border-radius: 8px; }
#Wrapper form[action="/settings"] .onoffswitch .frame::before { background: var(--vc-clay); color: var(--vc-sheet); }
#Wrapper form[action="/settings"] .onoffswitch .frame::after { background: var(--vc-fill); color: var(--vc-muted); }
#Wrapper form[action="/settings"] .onoffswitch .switch {
  background: var(--vc-sheet);
  box-shadow: inset 0 0 0 1px var(--vc-control);
  border-radius: 5px;
}
#Wrapper:has(form[action="/settings"]) .theme-switch {
  --theme-switch-track-color: var(--vc-fill);
  --theme-switch-track-hover-color: var(--vc-hover);
  --theme-switch-thumb-color: var(--vc-clay-tint);
  --theme-switch-thumb-hover-color: var(--vc-clay-tint);
  --theme-switch-glyph-color: var(--vc-muted);
  --theme-switch-glyph-hover-color: var(--vc-ink);
  --theme-switch-glyph-chosen-color: var(--vc-clay);
  --theme-switch-glyph-chosen-hover-color: var(--vc-clay);
}
#Wrapper form[action="/settings"] :is(select:not(.select2-hidden-accessible), .select2-selection--single) {
  box-sizing: border-box;
  height: 32px;
  border: 1px solid var(--vc-control);
  border-radius: 7px;
  background: var(--vc-sheet);
  color: var(--vc-ink);
  font: 400 13px/1.2 var(--vc-ui);
}
#Wrapper form[action="/settings"] select:not(.select2-hidden-accessible) { padding-inline: 7px; }
#Wrapper form[action="/settings"] .select2-container { max-width: 100%; }
#Wrapper form[action="/settings"] .select2-selection__rendered { color: var(--vc-ink); line-height: 30px; }
#Wrapper form[action="/settings"] .select2-selection__arrow { height: 30px; }
#Wrapper form[action="/settings"] .select2-selection__arrow b { border-block-color: var(--vc-muted); }
/* Select2 appends its open menu directly to body. */
:root:has(form[action="/settings"]) body > .select2-container--open .select2-dropdown {
  background: var(--vc-sheet);
  border-color: var(--vc-control);
  color: var(--vc-ink);
}
:root:has(form[action="/settings"]) body > .select2-container--open .select2-search__field {
  border-color: var(--vc-control);
  background: var(--vc-sheet);
  color: var(--vc-ink);
}
:root:has(form[action="/settings"]) body > .select2-container--open .select2-results__option--selected {
  background: var(--vc-fill);
}
:root:has(form[action="/settings"]) body > .select2-container--open .select2-results__option--highlighted {
  background: var(--vc-clay-tint);
  color: var(--vc-clay);
}
@media (prefers-reduced-motion: reduce) {
  #Wrapper form[action="/settings"] .onoffswitch :is(.frame, .switch),
  #Wrapper:has(form[action="/settings"]) .theme-switch :is(.theme-switch-thumb, .theme-switch-glyph) { transition: none; }
}

/* 首页保持高密度：柔和的选中分区、低对比度元信息、对齐的回复数。 */
#Wrapper #Tabs {
  padding: 9px 11px;
  border-radius: var(--vc-radius) var(--vc-radius) 0 0;
  background: var(--vc-fill);
}
#Tabs :is(a.tab, a.tab_current):any-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  box-sizing: border-box;
  margin: 2px 2px 2px 0;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--vc-muted);
  font-size: 13px;
  line-height: 1.25;
}
#Tabs :is(a.tab, a.tab_current):hover { background: var(--vc-hover); color: var(--vc-ink); }
#Tabs a.tab_current:any-link {
  background: var(--vc-clay-tint);
  border-color: var(--vc-line);
  color: var(--vc-clay);
  font-weight: 600;
}
#Wrapper #SecondaryTabs {
  background: var(--vc-sheet);
  font-size: 13px;
  line-height: 1.8;
}
#SecondaryTabs a { white-space: nowrap; }
#Wrapper .box > .cell.item { padding-block: 12px; }
#Wrapper .box > .cell.item:focus-within { background: var(--vc-fill); }
@media (hover: hover) {
  #Wrapper .box > .cell.item:hover { background: var(--vc-canvas); }
}
.item_title { font-size: 16px; font-weight: 400; line-height: 1.45; overflow-wrap: anywhere; }
#Wrapper .item_title a:any-link { color: var(--vc-ink); text-underline-offset: .18em; }
#Wrapper .item_title a:visited { color: var(--vc-muted); }
#Wrapper :is(.topic_info, .ago, .gray, .fade, .snow, .chevron) { color: var(--vc-muted); }
#Wrapper :is(.topic_info, .cell.item .small) { line-height: 1.55; }
#Wrapper img.avatar { border-radius: 7px; }
#Wrapper :is(a.node, a.tag):any-link {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--vc-fill);
  color: var(--vc-muted);
  box-shadow: none;
  line-height: 1.35;
}
#Wrapper :is(a.node, a.tag):hover { background: var(--vc-hover); color: var(--vc-ink); }

/* 位面目录：以原生图标区分位面，文字和纸面沿用主题。 */
#Wrapper .box:has(> .inner > a.item_node) > .header:has(> .spacer + span[style]) {
  gap: 6px 10px;
  flex-wrap: wrap;
  border-radius: calc(var(--vc-radius) - 1px) calc(var(--vc-radius) - 1px) 0 0 !important;
  background-color: var(--vc-fill) !important;
  color: var(--vc-ink) !important;
}
#Wrapper .box:has(> .inner > a.item_node) > .header > .spacer + span[style] {
  flex-wrap: wrap;
  color: var(--vc-muted) !important;
}
#Wrapper .box:has(> .header > .spacer + span[style]) > .inner:has(> a.item_node) {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 7px;
}
#Wrapper .box:has(> .header > .spacer + span[style]) > .inner > a.item_node:any-link {
  box-sizing: border-box;
  max-width: 100%;
  margin: 0;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--vc-fill);
  color: var(--vc-ink);
  box-shadow: none;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
#Wrapper .box:has(> .header > .spacer + span[style]) > .inner > a.item_node:is(:hover, :focus-visible) {
  background: var(--vc-clay-tint);
  color: var(--vc-clay);
}
#Wrapper :is(a.count_livid, a.count_orange, a.count_blue, a.count_green):any-link {
  box-sizing: border-box;
  min-width: 2.5em;
  margin-inline: 0;
  padding: 4px 7px;
  background: var(--vc-fill);
  color: var(--vc-muted);
  border-radius: 6px;
  font: 400 12px/1.3 var(--vc-ui);
  font-variant-numeric: tabular-nums;
  text-align: center;
  word-break: normal;
}
#Wrapper a.count_orange:not(:visited) {
  background: var(--vc-clay-tint);
  color: var(--vc-clay);
  font-weight: 600;
}
#Wrapper :is(a.count_livid, a.count_orange, a.count_blue, a.count_green):hover {
  background: var(--vc-hover);
  color: var(--vc-ink);
  text-decoration: underline;
}

/* 帖子切换到阅读排版；元数据、回复工具和代码保持各自的字族。 */
#Wrapper .box > .header:has(h1) { padding-block: 22px 18px; }
#Wrapper .header h1 {
  margin-block: .25em .45em;
  color: var(--vc-ink);
  font: 600 clamp(18px, 1.85vw, 24px)/1.28 var(--vc-reading);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
#Wrapper #topic-replies a.dark:any-link { color: var(--vc-ink); }
#Wrapper :is(.topic_content, .reply_content) {
  color: var(--vc-ink);
  font-family: var(--vc-reading);
  overflow-wrap: anywhere;
}
#Wrapper .topic_content { max-width: 72ch; font-size: 16px; line-height: 1.85; }
#Wrapper .reply_content { font-size: 15px; line-height: 1.7; }
#Wrapper :is(.topic_content, .reply_content) a:any-link {
  color: var(--vc-clay);
  text-decoration: underline;
  text-underline-offset: .17em;
}
#Wrapper :is(.topic_content, .reply_content) :is(pre, code, kbd) {
  font-family: var(--vc-mono);
}
#Wrapper :is(.topic_content, .reply_content) :is(pre, :not(pre) > code) {
  background: var(--vc-fill);
  border-radius: 7px;
}
#Wrapper :is(.topic_content, .reply_content) pre {
  box-sizing: border-box;
  max-width: 100%;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--vc-line);
}
#Wrapper :is(.topic_content, .reply_content) pre > code { background: transparent; }
#Wrapper :is(.topic_content, .reply_content) blockquote {
  border-inline-start-color: var(--vc-control);
  color: var(--vc-muted);
}
#Wrapper :is(.topic_buttons, .cell.buttons, .inner.buttons) {
  background: var(--vc-fill);
  border-radius: 0 0 var(--vc-radius) var(--vc-radius);
  filter: none;
}
#Wrapper .subtle { background: var(--vc-fill); border-inline-start-color: var(--vc-control); }

:is(#Wrapper, #Top, #site-header, #Bottom) :is(.sl, .sll, .sls, .ml, .mll, .mle) {
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--vc-control);
  border-radius: 8px;
  background: var(--vc-sheet);
  color: var(--vc-ink);
  box-shadow: none;
  font-family: var(--vc-ui);
}
#Wrapper :is(.mll, .mle, .ml.code) { font-family: var(--vc-mono); }
:is(#Wrapper, #Top, #site-header, #Bottom) .super.button {
  box-sizing: border-box;
  padding: 7px 12px;
  border: 1px solid var(--vc-control);
  border-radius: 8px;
  background: var(--vc-sheet);
  color: var(--vc-ink);
  box-shadow: none;
  text-shadow: none;
  font: 600 13px/1.4 var(--vc-ui);
}
:is(#Wrapper, #Top, #site-header, #Bottom) .super.button:not(:disabled):hover {
  border-color: var(--vc-control);
  background: var(--vc-hover);
  color: var(--vc-ink);
  box-shadow: none;
  text-shadow: none;
}
:is(#Wrapper, #Top, #site-header) :is(input[type="submit"], button[type="submit"], a[href="/signup"]).super.normal.button {
  border-color: transparent;
  background: var(--vc-action);
  color: var(--vc-on-action);
}
:is(#Wrapper, #Top, #site-header) :is(input[type="submit"], button[type="submit"], a[href="/signup"]).super.normal.button:not(:disabled):hover {
  background: var(--vc-action-hover);
  color: var(--vc-on-action);
}
#Wrapper .super.button:disabled { opacity: .55; cursor: not-allowed; }
#Wrapper :is(.page_normal, .page_current) {
  padding: 4px 7px;
  border: 1px solid var(--vc-line);
  border-radius: 6px;
  background: var(--vc-sheet);
  color: var(--vc-muted);
  box-shadow: none;
}
#Wrapper .page_normal:hover { background: var(--vc-fill); color: var(--vc-ink); }
#Wrapper .page_current { background: var(--vc-clay-tint); color: var(--vc-clay); font-weight: 600; }

:is(#Wrapper, #Top, #site-header, #Bottom) :is(a, button, input, select, textarea, [tabindex]):focus-visible,
:is(#Top, #site-header) #search-container:focus-within {
  outline: 2px solid var(--vc-clay);
  outline-offset: 2px;
}
#search-container #search:focus-visible { outline: none; }
::selection { background: var(--vc-clay-tint); color: var(--vc-ink); }

@media (max-width: 840px) {
  #Main { margin-inline: 0; }
  #Wrapper > .content:has(> #Main) { display: flex; flex-direction: column; }
  #Rightbar { float: none; order: 1; width: auto; }
  #Leftbar:empty { display: none; }
}
@media (max-width: 520px) {
  :root:root { --vc-gutter: 10px; --vc-pad: 12px; --vc-radius: 12px; }
  #Top { height: auto; }
  #Top .site-nav { flex-wrap: wrap; gap: 6px; padding-block: 8px; }
  #Top .site-nav .tools { flex: 1 1 max-content; }
  #Top #search-container { margin-left: 0; flex: 1 1 90px; width: auto; max-width: 245px; }
  #site-header #search-container { flex: 1 1 auto; width: auto; }
  #Wrapper #Tabs { padding: 6px 8px; }
  #Tabs :is(a.tab, a.tab_current):any-link { padding-inline: 6px; }
  #Wrapper .cell.item td[width="70"] { width: 42px; }
  #Wrapper .cell.item td[width="48"] { width: 32px; }
  #Wrapper .cell.item td[width="48"] .avatar { width: 32px !important; }
}
@media (prefers-reduced-motion: reduce) {
  #search-container, #search-container::before,
  #Wrapper :is(.sl, .sll, .sls, .ml, .mll, .mle, .super.button) { transition: none; }
}
