/* =============================================================
   dayeku.com · v2 全站基础样式
   目标：紧凑、可读、耐看；不用大发光/大渐变/满屏卡片；
   对旧一点的浏览器兼容（Safari 13+ / iOS 13+ / 主流桌面浏览器 last-2）。
   ============================================================= */

:root {
  --bg:        #faf8f2;
  --bg-alt:    #f4f0e5;
  --surface:   #ffffff;
  --ink:       #17172a;
  --ink-2:     #383846;
  --muted:     #6b6976;
  --muted-2:   #8a8894;
  --line:      #e6e0d3;
  --line-2:    #cfc9ba;
  --line-strong:#b8b1a1;
  --focus:     #1a4b8f;

  --accent:      #a01e2b;
  --accent-ink:  #ffffff;
  --accent-soft: #f7e6e7;
  --link:        #2a4b8f;
  --success-ink: #175b34;
  --success-bg:  #e6f3ea;
  --danger-ink:  #8f1c1c;
  --danger-bg:   #fbecec;

  --code-bg:   #f2eee1;
  --code-ink:  #322f26;

  --r-1: 3px;
  --r-2: 6px;
  --r-3: 10px;
  --shadow-1: 0 1px 0 rgba(21,21,32,0.04);
  --shadow-2: 0 1px 0 rgba(21,21,32,0.04), 0 4px 10px -6px rgba(21,21,32,0.08);
  --shadow-focus: 0 0 0 3px rgba(26,75,143,0.25);

  --wrap: 1140px;
  --nav-h: 52px;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Source Han Sans SC", "Noto Sans CJK SC", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Cascadia Mono", "Roboto Mono", "Noto Sans Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 400 15.5px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -0.005em; }
h1 { font-size: 1.8rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem;    font-weight: 600; }
p  { margin: .4em 0 .8em; }
a  { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); text-decoration-thickness: 1px; transition: color .12s, text-decoration-color .12s; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
a:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-1); }
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-1); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: transparent; border: 0; }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--code-bg); color: var(--code-ink); padding: .1em .35em; border-radius: var(--r-1); }
pre  { background: var(--code-bg); color: var(--code-ink); padding: .6em .8em; border-radius: var(--r-2); overflow-x: auto; }

img, svg { max-width: 100%; height: auto; display: inline-block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; }
.visually-hidden { position:absolute!important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.skip { position:absolute; top:-40px; left:8px; padding:6px 12px; background: var(--ink); color:#fff; text-decoration:none; z-index:999; border-radius: var(--r-1); }
.skip:focus { top: 8px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 700;
  padding: 4px 4px 4px 0;
}
.brand:hover { color: var(--accent); }
.brand-mark {
  color: var(--accent);
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  border-radius: var(--r-2);
  border: 1px solid rgba(160,30,43,0.15);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-size: 1.05rem; letter-spacing: .01em; }
.brand-wordmark { display: block; height: 42px; width: auto; }

.search {
  display: flex; align-items: stretch;
  max-width: 460px; width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  overflow: hidden;
  transition: border-color .12s, box-shadow .12s;
}
.search:focus-within { border-color: var(--focus); box-shadow: var(--shadow-focus); }
.search input { flex:1; border:0; padding: 9px 12px; outline: 0; min-width: 0; background: transparent; font-size: .95rem; }
.search button {
  padding: 0 14px; border-left: 1px solid var(--line);
  color: var(--muted); font-size: .9rem; font-weight: 500;
}
.search button:hover { color: var(--accent); }

.lang {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line-2); border-radius: var(--r-2);
  overflow: hidden; background: var(--surface);
}
.lang a {
  padding: 7px 11px; font-size: 12.5px;
  text-decoration: none; color: var(--muted);
  border-right: 1px solid var(--line);
  line-height: 1.2;
}
.lang a:last-child { border-right: 0; }
.lang a:hover { background: var(--bg-alt); color: var(--ink); }
.lang a.is-active { background: var(--ink); color:#fff; }

/* Nav */
.site-nav { background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.site-nav > .wrap { padding-left: 20px; padding-right: 20px; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 2px;
  min-height: var(--nav-h); align-items: stretch;
}
.site-nav li.spacer { flex: 1; }
.site-nav a {
  display: inline-flex; align-items: center;
  padding: 0 12px; font-size: 14px; height: var(--nav-h);
  text-decoration: none; color: var(--ink-2);
  border-bottom: 2px solid transparent;
  transition: color .12s, border-color .12s;
}
.site-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); background: rgba(160,30,43,.03); }

/* Breadcrumbs */
.crumbs ol {
  list-style: none; margin: 0; padding: 14px 0 2px;
  display: flex; flex-wrap: wrap; gap: 4px 6px;
  font-size: 13px; color: var(--muted);
}
.crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.crumbs li + li::before { content: "›"; color: var(--line-2); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 500; }

/* Main */
.main { padding: 4px 0 56px; flex: 1; }

.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); font-weight: 600;
  margin: 26px 0 10px;
}

.lede, .hero-lede { color: var(--muted); font-size: .98rem; margin: 0 0 12px; }

/* Home hero */
.hero-lite {
  padding: 26px 0 14px;
  border-bottom: 1px dashed var(--line-2);
  margin-bottom: 6px;
}
.hero-lite h1 { font-size: clamp(1.7rem, 2.6vw + .6rem, 2.2rem); margin: 0 0 6px; }
.hero-search {
  display: flex; gap: 10px; max-width: 620px; margin-top: 14px;
}
.hero-search input {
  flex: 1; border: 1px solid var(--line-2);
  border-radius: var(--r-2); padding: 12px 14px;
  background: var(--surface); font-size: 1rem;
  transition: border-color .12s, box-shadow .12s;
}
.hero-search input:focus { outline: none; border-color: var(--focus); box-shadow: var(--shadow-focus); }
.hero-search button {
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  padding: 0 20px; border-radius: var(--r-2); font-weight: 500;
}
.hero-search button:hover { background: var(--accent); border-color: var(--accent); }

/* Tool cards */
.tools-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.tools-grid--compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tools-grid--wide    { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  transition: border-color .12s, box-shadow .12s;
}
.tool-card:hover { border-color: var(--ink); box-shadow: var(--shadow-2); }
.tool-card a {
  display: block; padding: 12px 14px 13px;
  text-decoration: none; color: var(--ink);
}
.tool-card a:hover { color: var(--accent); }
.tool-name { display: block; font-weight: 600; font-size: 14.5px; letter-spacing: .005em; }
.tool-list-icon { width: 28px; height: 28px; flex: 0 0 28px; vertical-align: middle; margin-right: 8px; }
.tool-name, .tools-list__name, .related-list .name { display: flex; align-items: center; min-width: 0; }
.tools-list__name { flex: 1; }
.tools-list__summary { max-width: 40%; }
.tool-summary { display: block; margin-top: 3px; font-size: 12.8px; color: var(--muted); line-height: 1.5; }

/* All-categories block */
.all-cats { display: grid; gap: 30px; margin-top: 12px; }
.cat-block__head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px;
  gap: 10px; flex-wrap: wrap;
}
.cat-block__head h2 { margin: 0; font-size: 1.05rem; }
.cat-block__head h2 a { color: var(--ink); text-decoration: none; }
.cat-block__head h2 a:hover { color: var(--accent); }
.cat-desc { color: var(--muted); font-size: 12.8px; margin: 0; }

.tools-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 4px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.tools-list a {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px; padding: 7px 10px; border-radius: var(--r-1);
  text-decoration: none; color: var(--ink); border: 1px solid transparent;
}
.tools-list a:hover { background: var(--bg-alt); color: var(--accent); border-color: var(--line); }
.tools-list__name { font-weight: 500; font-size: 14px; }
.tools-list__summary { color: var(--muted); font-size: 12.5px; max-width: 100%; padding-left: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Page head */
.page-head { margin: 14px 0 22px; }
.page-head h1 { font-size: clamp(1.5rem, 1.6vw + 1rem, 1.9rem); margin: 0 0 6px; }

/* Prose */
.prose { max-width: 720px; font-size: 15.5px; }
.prose h1 { font-size: 1.7rem; margin: 0 0 14px; }
.prose h2 { font-size: 1.1rem; margin: 22px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 1rem; margin: 16px 0 6px; }
.prose p  { margin: 8px 0 12px; }
.prose ul, .prose ol { padding-left: 22px; margin: 6px 0 14px; }
.prose li { margin: 3px 0; }
.prose code { background: var(--code-bg); }
.prose a { color: var(--link); text-decoration-color: var(--link); }
.prose a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* Buttons */
.btn {
  display: inline-block;
  border: 1px solid var(--ink); background: var(--ink); color:#fff!important;
  text-decoration: none; padding: 9px 16px; border-radius: var(--r-2);
  font-weight: 500;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink)!important; }
.btn.ghost:hover { background: var(--code-bg); color: var(--accent)!important; }

/* Search page */
.search-form { display: flex; gap: 10px; max-width: 640px; }
.search-form input {
  min-width: 0;
  flex: 1; padding: 11px 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-2);
  background: var(--surface);
}
.search-form input:focus { outline: none; border-color: var(--focus); box-shadow: var(--shadow-focus); }
.search-form button {
  border: 1px solid var(--ink); background: var(--ink); color:#fff;
  padding: 11px 20px; border-radius: var(--r-2); font-weight: 500;
}
.empty { color: var(--muted); padding: 12px 0; font-size: .95rem; }
.result-count { color: var(--muted); font-size: 13.5px; margin: 4px 0 14px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--muted);
  margin-top: 40px;
  font-size: 13.5px;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 22px 0; flex-wrap: wrap;
}
.foot-brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.foot-brand .brand-name { color: var(--ink); font-weight: 600; }
.foot-tagline { color: var(--muted); }
.foot-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-nav a { color: var(--muted); text-decoration: none; }
.foot-nav a:hover { color: var(--accent); }
.foot-legal { color: var(--muted-2); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand lang"
      "search search";
    gap: 8px;
  }
  .brand   { grid-area: brand; }
  .lang    { grid-area: lang; }
  .search  { grid-area: search; max-width: none; }
  .site-nav ul { min-height: 44px; }
  .site-nav a { height: 44px; padding: 0 10px; font-size: 13.5px; }
  .hero-lite { padding: 20px 0 12px; }
  .cat-block__head h2 { font-size: 1rem; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 480px) {
  body { font-size: 14.5px; }
  .wrap { padding-left: 14px; padding-right: 14px; }
  .header-inner { padding: 10px 14px; }
  .hero-search { flex-direction: column; }
  .hero-search button { padding: 12px 20px; }
  .foot-nav { gap: 12px; }
  .foot-nav a { font-size: 13px; }
}

/* Print */
@media print {
  .site-header, .site-nav, .site-footer, .search, .lang, .btn { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}
