/* TidyBar 官网样式：系统字体、无第三方资源、自带浅色/深色两档。 */

:root {
  color-scheme: light dark;
  --bg: #fbfbfd;
  --bg-translucent: rgba(251, 251, 253, 0.82);
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --accent: #0066cc;
  --border: #e3e3e8;
  --surface: #ffffff;
  --code: #f1f1f4;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  --radius: 14px;
  --wrap: 720px;
  --wrap-wide: 960px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-translucent: rgba(0, 0, 0, 0.72);
    --text: #f5f5f7;
    --secondary: #a1a1a6;
    --accent: #4da3ff;
    --border: #2c2c2e;
    --surface: #1c1c1e;
    --code: #2c2c2e;
    --shadow: none;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

img {
  max-width: 100%;
}

.wrap {
  width: min(100% - 40px, var(--wrap));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 100;
}

.skip:focus {
  left: 20px;
  top: 12px;
}

/* 页头 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-translucent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  width: min(100% - 40px, var(--wrap-wide));
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  display: block;
  border-radius: 7px;
}

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
}

.site-nav a {
  color: var(--secondary);
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.lang {
  margin-left: auto;
  font-size: 14px;
}

/* 正文 */

main {
  padding: 56px 0 96px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 42px;
  margin-bottom: 14px;
}

h2 {
  font-size: 29px;
  margin: 0 0 16px;
}

h3 {
  font-size: 21px;
}

p {
  margin: 0 0 18px;
}

main > h2 {
  margin-top: 64px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

main > h2:first-of-type {
  margin-top: 28px;
  padding-top: 0;
  border-top: 0;
}

main > hr + h2 {
  margin-top: 36px;
  padding-top: 0;
  border-top: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

main ul,
main ol {
  margin: 0 0 20px;
  padding-left: 1.35em;
}

main li {
  margin: 7px 0;
}

main li > p {
  margin: 0;
}

main p > img {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

strong {
  font-weight: 650;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

/* 首页首屏 */

body[data-page="home"] main {
  padding-top: 64px;
}

body[data-page="home"] main::before {
  content: "";
  display: block;
  width: 92px;
  height: 92px;
  margin: 0 0 28px;
  background: url("icon-96.png") center / contain no-repeat;
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

body[data-page="home"] main > h1 {
  font-size: clamp(56px, 10vw, 88px);
  letter-spacing: -0.045em;
  margin-bottom: 10px;
}

body[data-page="home"] main > h2:first-of-type {
  font-size: clamp(22px, 3.4vw, 34px);
  font-weight: 600;
  color: var(--secondary);
  letter-spacing: -0.025em;
  margin: 0 0 26px;
  max-width: 22em;
}

body[data-page="home"] main > p:nth-of-type(1) {
  font-size: 20px;
  line-height: 1.55;
  color: var(--secondary);
  max-width: 34em;
  margin-bottom: 22px;
}

body[data-page="home"] main > p:nth-of-type(2) {
  display: inline-block;
  margin: 0 0 12px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 15px;
  color: var(--secondary);
}

body[data-page="home"] main > p:nth-of-type(2) strong,
.store-button {
  color: var(--accent);
  font-weight: 650;
}

body[data-page="home"] main > p:nth-of-type(3) {
  font-size: 15px;
  color: var(--secondary);
  margin-bottom: 0;
}

/* 表格 */

.table-wrap {
  margin: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  background: var(--surface);
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* FAQ 手风琴 */

details.faq {
  border-bottom: 1px solid var(--border);
}

details.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding: 18px 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

details.faq summary::-webkit-details-marker {
  display: none;
}

details.faq summary h3 {
  font: inherit;
  line-height: 1.35;
  letter-spacing: inherit;
  margin: 0;
}

details.faq summary:hover {
  color: var(--accent);
}

details.faq summary::after {
  content: "+";
  color: var(--secondary);
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
  flex: none;
}

details.faq[open] summary::after {
  content: "−";
}

details.faq .faq-body {
  padding: 0 0 20px;
}

details.faq .faq-body > :last-child {
  margin-bottom: 0;
}

/* 页脚 */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  font-size: 14px;
  color: var(--secondary);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.site-footer nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--secondary);
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer p {
  margin: 0;
}

/* 窄屏 */

@media (max-width: 760px) {
  .wrap {
    width: min(100% - 32px, var(--wrap));
  }

  .site-header .wrap {
    width: min(100% - 32px, var(--wrap-wide));
    flex-wrap: wrap;
    gap: 4px 18px;
    padding: 10px 0;
  }

  .brand {
    margin-right: auto;
  }

  .lang {
    order: 2;
  }

  .site-nav {
    order: 3;
    width: 100%;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 2px;
    font-size: 13px;
  }

  main {
    padding: 40px 0 72px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 25px;
  }

  main > h2 {
    margin-top: 48px;
    padding-top: 28px;
  }

  body[data-page="home"] main {
    padding-top: 44px;
  }

  body[data-page="home"] main::before {
    width: 76px;
    height: 76px;
    margin-bottom: 22px;
    border-radius: 18px;
  }

  body[data-page="home"] main > h1 {
    font-size: clamp(48px, 16vw, 64px);
  }

  body[data-page="home"] main > p:nth-of-type(1) {
    font-size: 18px;
  }

  body[data-page="home"] main > p:nth-of-type(2) {
    font-size: 14px;
    padding: 8px 14px;
  }

  .site-footer .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}
