/* 一榫云官网 · 三站同源设计 token + 内容型排版 */
:root {
  --bg: #ffffff;
  --bg-subtle: #f7f7f8;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #8c8c8c;
  --accent: #fa8919;
  --accent-hover: #e67a00;
  --accent-soft: #fff4e8;
  --border: #ebebeb;
  --border-strong: #d9d9d9;
  --input-bg: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-segment: 0 1px 3px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[data-text-size="md"] { font-size: 18.5px; }
html[data-text-size="lg"] { font-size: 22px; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { letter-spacing: -0.02em; font-weight: 700; color: var(--text); }
h1 { font-size: 1.75rem; margin: 0 0 0.75rem; line-height: 1.25; }
h2 { font-size: 1.25rem; margin: 1.25rem 0 0.5rem; }
h3 { font-size: 1.0625rem; margin: 0 0 0.5rem; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 1rem; }

.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner { display: flex; flex-direction: column; gap: 0.5rem; }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.header-tools { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.logo { color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.0625rem; }
.logo:hover { color: var(--accent); }

.nav-main { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; }
.nav-main a { color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; }
.nav-main a:hover { color: var(--accent); }

.text-size-switch {
  display: inline-flex; background: rgba(0,0,0,0.06); border-radius: 9px; padding: 2px;
}
.text-size-btn {
  border: none; background: transparent; color: var(--muted); padding: 0.3rem 0.55rem;
  border-radius: 7px; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.text-size-btn[aria-pressed="true"] { background: #fff; box-shadow: var(--shadow-segment); color: var(--text); }

.lang-switch { position: relative; font-size: 13px; }
.lang-current { color: var(--muted); cursor: default; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lang-menu {
  display: none; position: absolute; right: 0; top: 100%; margin-top: 4px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-card); min-width: 120px; z-index: 200;
}
.lang-switch:hover .lang-menu { display: block; }
.lang-menu a { display: block; padding: 0.5rem 0.75rem; color: var(--text); text-decoration: none; }
.lang-menu a:hover { background: var(--bg-subtle); color: var(--accent); }

.site-main { padding: 2rem 0 3rem; min-height: 55vh; }
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0; font-size: 0.875rem; color: var(--muted); background: var(--bg-subtle); }
.footer-company { text-align: center; }
.footer-product { margin: 0 0 0.35rem; font-size: 1rem; }
.footer-product-link { color: var(--text); text-decoration: none; font-weight: 600; }
.footer-product-link:hover { color: var(--accent); }
.footer-product-current .footer-product-link { color: var(--accent); }
.footer-product-sister { margin-top: 0.5rem; }
.footer-site-url { margin: 0 0 0.25rem; }
.footer-site-link { color: var(--muted); text-decoration: none; }
.footer-operator { margin: 0.5rem 0 0.35rem; color: var(--text); }
.footer-icp-line { margin: 0.5rem 0; color: var(--text); }
.footer-icp-num { font-weight: 700; color: var(--text) !important; text-decoration: none; }
.footer-contact a { color: var(--muted); }
.footer-note { margin-top: 0.75rem; font-size: 0.8125rem; }

.hero h1 { font-size: 2rem; }
.hero-kicker { color: var(--muted); font-size: 0.9375rem; margin: 0 0 0.5rem; }
.lead { color: var(--muted); max-width: 42em; font-size: 1.0625rem; }
.hero-actions { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

.section-block { margin-top: 2.5rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.25rem; box-shadow: var(--shadow-sm);
}
.card-featured { border-color: var(--accent-soft); background: linear-gradient(180deg, #fffaf5 0%, #fff 100%); }

/* 方向卡片封面：黄金分割 宽:高 = 1:0.618 */
.card-cover-frame {
  margin: -1.25rem -1.25rem 1rem;
  width: calc(100% + 2.5rem);
  aspect-ratio: 1 / 0.618;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-subtle);
}
.card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 0;
  margin: 0;
}
.card a { color: var(--accent); text-decoration: none; }
.card a:hover { color: var(--accent-hover); }

.btn {
  display: inline-block; padding: 0.625rem 1.125rem; border-radius: 980px;
  border: 1px solid var(--border-strong); background: var(--card); color: var(--text);
  text-decoration: none; cursor: pointer; font-size: 1rem; font-family: inherit; font-weight: 500; min-height: 2.75rem;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.875rem; min-height: 2.25rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-danger { border-color: #ffccc7; color: #cf1322; }
.btn-danger:hover { background: #fff2f0; }

.form label { display: block; margin-bottom: 1rem; font-weight: 500; }
.form input[type="text"], .form input[type="email"], .form input[type="password"],
.form input[type="number"], .form input[type="datetime-local"], .form select, .form textarea {
  width: 100%; max-width: 480px; padding: 0.625rem 0.75rem; margin-top: 0.35rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--input-bg);
  font-size: 1rem; font-family: inherit; min-height: 2.75rem;
}
.form textarea { min-height: 8rem; max-width: 100%; }
.form textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: 0.875rem; min-height: 14rem; max-width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(250, 137, 25, 0.15);
}
.form-row { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.form-row label { flex: 1 1 12rem; }

.alert { padding: 0.875rem 1rem; border-radius: var(--radius-md); margin: 0 0 1rem; }
.alert-ok { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.alert-error { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }
.alert-warn { background: #fffbe6; color: #ad6800; border: 1px solid #ffe58f; }

.hint, .muted { color: var(--muted); font-size: 0.9375rem; }
.box-muted { background: var(--bg-subtle); border: 1px solid var(--border); padding: 1rem 1.125rem; border-radius: var(--radius-md); margin-top: 1.5rem; }

.prose h2 { margin-top: 1.5rem; font-size: 1.125rem; }
.prose h3 { margin-top: 1.25rem; }
.prose p, .prose ul { margin: 0.75rem 0; }
.prose ul { padding-left: 1.25rem; }
.prose a { color: var(--accent); }
.prose code { background: #f5f5f5; padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.9em; }

.table-simple { width: 100%; border-collapse: collapse; font-size: 0.9375rem; margin: 1rem 0; }
.table-simple th, .table-simple td { border: 1px solid var(--border); padding: 0.625rem 0.75rem; text-align: left; vertical-align: top; }
.table-simple th { background: var(--bg-subtle); font-weight: 600; }
.table-compact td, .table-compact th { font-size: 0.875rem; }

.tag { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.tag-cat { background: var(--accent-soft); color: #d96b00; }
.tag-draft { background: #f5f5f5; color: var(--muted); }
.tag-published { background: #f6ffed; color: #389e0d; }

.news-list { list-style: none; padding: 0; margin: 0; }
.news-item { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: none; }
.news-title { display: inline; font-weight: 600; color: var(--text); text-decoration: none; margin-right: 0.5rem; }
.news-title:hover { color: var(--accent); }
.news-date { font-size: 0.875rem; }
.news-summary { margin: 0.5rem 0 0; color: var(--muted); max-width: 48em; }
.read-more { font-size: 0.9375rem; color: var(--accent); text-decoration: none; }
.read-more:hover { color: var(--accent-hover); }

.cat-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.25rem 0 1.5rem; }
.cat-tab {
  padding: 0.4rem 0.85rem; border-radius: 980px; border: 1px solid var(--border);
  text-decoration: none; color: var(--muted); font-size: 0.9375rem;
}
.cat-tab:hover { border-color: var(--accent); color: var(--accent); }
.cat-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.pagination { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 1.5rem; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; height: 2.25rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; color: var(--text);
}
.page-link.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.article-single { max-width: 720px; }
.article-header { margin-bottom: 1.5rem; }
.article-meta { font-size: 0.875rem; color: var(--muted); margin: 0 0 0.75rem; }
.article-cover {
  margin: 1.25rem 0 1.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-subtle);
  aspect-ratio: 1 / 0.618;
}
.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  margin: 0;
  border-radius: 0;
}
.article-body { margin-top: 1.5rem; }
.prose img,
.prose-figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
  margin: 1rem auto;
}
.prose-figure { margin: 1.25rem 0; text-align: center; }
.prose-figure figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 0.5rem; }
.article-back { margin-top: 2rem; }
.article-back a { color: var(--accent); text-decoration: none; }

.contact-dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0; }
.contact-dl dt { font-weight: 600; color: var(--text); }
.contact-dl dd { margin: 0; color: var(--muted); }

.admin-tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.admin-tab {
  padding: 0.75rem 1rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.admin-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

.page-admin-login .site-header, .page-admin-login .site-footer { display: none; }
.login-panel { max-width: 400px; margin: 4rem auto; padding: 2rem; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }

.thumb-sm { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.625rem; }
  .header-top { flex-direction: column; align-items: flex-start; }
}
