:root {
  --bg: #faf8f5;
  --bg-elevated: #ffffff;
  --bg-subtle: #f2ede6;
  --text: #221f1c;
  --text-muted: #6e675f;
  --border: #e7dfd5;
  --accent: #c86d3b;
  --accent-soft: rgba(200, 109, 59, 0.12);
  --accent-hover: #ad592b;
  --shadow: 0 8px 30px rgba(34, 31, 28, 0.06);
  --radius: 14px;
  --radius-sm: 9px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #141517;
  --bg-elevated: #1c1e21;
  --bg-subtle: #24272b;
  --text: #edeae5;
  --text-muted: #9a958d;
  --border: #2c3035;
  --accent: #e08a58;
  --accent-soft: rgba(224, 138, 88, 0.15);
  --accent-hover: #ee9d6e;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font-family: inherit; color: inherit; }
.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 24px; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand-domain { font-size: 0.78rem; color: var(--text-muted); font-weight: 400; font-family: var(--font-mono); }
.nav { display: flex; align-items: center; gap: 20px; }
.nav a { font-size: 0.92rem; color: var(--text-muted); transition: color 0.15s ease; }
.nav a:hover { color: var(--text); }
.theme-btn {
  border: 1px solid var(--border); background: var(--bg-elevated);
  border-radius: 999px; padding: 6px 12px; font-size: 0.82rem; cursor: pointer;
  color: var(--text-muted); transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-btn:hover { border-color: var(--accent); color: var(--text); }

.hero { padding: 68px 0 44px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem;
  padding: 5px 12px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-weight: 500; margin-bottom: 18px;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.hero h1 { margin: 0 0 14px; font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.25; letter-spacing: -0.02em; }
.hero p { margin: 0; max-width: 620px; color: var(--text-muted); font-size: 1.02rem; }

.section { padding: 36px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.section-title { margin: 0; font-size: 1.25rem; letter-spacing: -0.01em; }
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pill {
  border: 1px solid var(--border); background: transparent; padding: 5px 13px;
  border-radius: 999px; font-size: 0.84rem; color: var(--text-muted); cursor: pointer; transition: all 0.15s ease;
}
.filter-pill:hover { border-color: var(--accent); color: var(--text); }
.filter-pill.active { background: var(--accent); border-color: var(--accent); color: #ffffff; }

.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.note-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; cursor: pointer; display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.note-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.note-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); }
.note-tag { background: var(--bg-subtle); color: var(--text-muted); padding: 2px 9px; border-radius: 999px; font-family: var(--font-sans); }
.note-card h3 { margin: 0; font-size: 1.08rem; line-height: 1.4; }
.note-card p { margin: 0; font-size: 0.91rem; color: var(--text-muted); }
.note-read-more { margin-top: auto; padding-top: 6px; font-size: 0.84rem; color: var(--accent); font-weight: 500; }

.tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tool-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.tool-card h3 { margin: 0; font-size: 1rem; }
.tool-desc { margin: -8px 0 0; font-size: 0.83rem; color: var(--text-muted); }

.timer-display { font-family: var(--font-mono); font-size: 2.3rem; font-weight: 600; text-align: center; letter-spacing: 0.04em; padding: 10px 0 4px; }
.timer-bar { height: 6px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; }
.timer-bar-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.3s linear; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  flex: 1; border: 1px solid var(--border); background: var(--bg-subtle);
  padding: 7px 10px; border-radius: var(--radius-sm); font-size: 0.84rem;
  cursor: pointer; transition: all 0.15s ease; text-align: center;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-xs { padding: 4px 8px; font-size: 0.78rem; }

.color-preview {
  height: 54px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.88rem; font-weight: 600;
}
.color-inputs { display: flex; gap: 8px; align-items: center; }
.color-inputs input[type="color"] { width: 42px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; padding: 2px; cursor: pointer; }
.text-input { width: 100%; border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius-sm); padding: 7px 10px; font-size: 0.86rem; font-family: var(--font-mono); }
.text-input:focus, .text-area:focus { outline: none; border-color: var(--accent); }
.color-values { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; font-family: var(--font-mono); color: var(--text-muted); }
.copy-row { display: flex; align-items: center; justify-content: space-between; background: var(--bg-subtle); padding: 6px 10px; border-radius: 7px; gap: 8px; }
.copy-btn { border: none; background: transparent; color: var(--accent); font-size: 0.76rem; cursor: pointer; padding: 0; font-family: var(--font-sans); }

.text-area { width: 100%; min-height: 98px; resize: vertical; border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius-sm); padding: 10px; font-size: 0.86rem; line-height: 1.5; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat-box { background: var(--bg-subtle); border-radius: 8px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8rem; color: var(--text-muted); }
.stat-box strong { color: var(--text); font-family: var(--font-mono); font-size: 0.95rem; }

.about-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: center;
}
.about-card h3 { margin: 0 0 10px; font-size: 1.1rem; }
.about-card p { margin: 0; color: var(--text-muted); font-size: 0.93rem; }
.about-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 0.86rem; }
.about-facts li { display: flex; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.about-facts span { color: var(--text-muted); }

.site-footer { margin-top: 40px; border-top: 1px solid var(--border); padding: 26px 0 42px; font-size: 0.84rem; color: var(--text-muted); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 14, 13, 0.56);
  backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-panel {
  width: 100%; max-width: 660px; max-height: 84vh; overflow-y: auto;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 30px; box-shadow: var(--shadow);
}
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.modal-header h2 { margin: 6px 0 0; font-size: 1.35rem; line-height: 1.35; }
.modal-close { border: 1px solid var(--border); background: var(--bg-subtle); width: 34px; height: 34px; border-radius: 999px; cursor: pointer; font-size: 1.1rem; line-height: 1; flex-shrink: 0; }
.modal-body p { margin: 0 0 14px; color: var(--text); font-size: 0.96rem; }
.modal-body ul { margin: 0 0 16px; padding-left: 20px; color: var(--text-muted); font-size: 0.93rem; }
.modal-body li { margin-bottom: 6px; }

@media (max-width: 820px) {
  .tools-grid, .notes-grid, .about-card { grid-template-columns: 1fr; }
  .brand-domain { display: none; }
}
