/* Timestamp 工具样式：紫色主题，与站点浅色风格协调。
   站点外壳（导航条 / 广告位）的自包含样式在本文件顶部 —— 工具页不引 assets/site.css。 */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e5e7eb;
  --text: #1f2328;
  --muted: #6b7280;
  --accent: #5b5bd6;
  --accent-dark: #4b4bc4;
  --accent-soft: #eef0fd;
  --accent-ink: #3730a3;
  --bad: #b91c1c;
  --ok: #0f766e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ 站点外壳 */
.site-nav {
  display: flex; align-items: center; gap: 16px;
  height: 52px; padding: 0 20px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.site-nav a { text-decoration: none; color: var(--muted); font-size: 13px; }
.site-nav a:hover { color: var(--accent); }
.site-nav .brand {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 650; color: var(--text);
}
.site-nav .brand i {
  width: 20px; height: 20px; border-radius: 5px; background: #2563eb; color: #fff;
  font-size: 10px; font-style: normal; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.site-nav .back { margin-left: auto; }

/* 广告位：为空时不占位；内容承载在 ads/slot.html 的 iframe 里，固定高度防布局跳动 */
.ad { position: relative; display: flex; justify-content: center; }
.ad:empty { display: none; }
.ad-frame { display: block; width: 100%; height: 100%; border: 0; }
.ad-inline { width: 100%; max-width: 1040px; height: 90px; margin: 0 auto; }
.ad-label {
  position: absolute; right: 8px; top: 2px; pointer-events: none;
  font-size: 10px; line-height: 14px; padding: 0 4px; border-radius: 4px;
  color: #9ca3af; background: rgba(255,255,255,.9); border: 1px solid var(--line);
}

/* ------------------------------------------------------------ 页面 */
.page { max-width: 1040px; margin: 0 auto; padding: 34px 20px 48px; }

h1 {
  margin: 0 0 8px; font-size: 28px; font-weight: 650;
  text-align: center; letter-spacing: .2px;
}
.lead { margin: 0 0 26px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------ 实时面板 */
.now {
  display: flex; gap: 12px;
  background: var(--accent); color: #fff;
  border-radius: 14px; padding: 20px 16px; margin-bottom: 22px;
  box-shadow: 0 8px 22px rgba(91, 91, 214, .18);
}
.now-item { flex: 1; text-align: center; min-width: 0; }
.now-item span {
  display: block; font-size: 12px; opacity: .85; margin-bottom: 6px;
  white-space: nowrap;
}
.now-item b {
  display: block; font-size: 19px; font-weight: 600;
  font-family: var(--mono); letter-spacing: .5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ------------------------------------------------------------ 卡片 */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px 20px;
  display: flex; flex-direction: column;
}
.card h2 {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 20px; font-size: 17px; font-weight: 600;
}
.card h2 .ico { width: 21px; height: 21px; color: var(--accent); flex: 0 0 21px; }

.lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.hint { margin: 7px 0 0; font-size: 12px; color: var(--muted); min-height: 18px; }

input[type="datetime-local"],
input[type="text"] {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 9px;
  font: 14px var(--mono); color: var(--text); background: #fff;
  outline: none;
}
input[type="datetime-local"]:focus,
input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder { color: #b6bcc6; }

/* 秒级 / 毫秒级 切换 */
.seg {
  display: flex; gap: 8px; margin-bottom: 18px;
  background: var(--bg); border-radius: 10px; padding: 4px;
}
.seg button {
  flex: 1; padding: 9px 6px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 13px; font-family: inherit;
  cursor: pointer; transition: .15s;
}
.seg button:hover { color: var(--accent); }
.seg button.active {
  background: var(--accent); color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(91, 91, 214, .22);
}

/* ------------------------------------------------------------ 按钮 */
.btn {
  font-family: inherit; font-size: 14px; cursor: pointer;
  border-radius: 9px; border: 1px solid var(--line);
  padding: 11px 16px; background: #fff; color: var(--text);
  transition: .15s;
}
.btn.primary {
  margin-top: 16px;
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.primary:active { transform: translateY(1px); }
.btn.ghost {
  margin-top: 14px; align-self: flex-start;
  font-size: 13px; padding: 8px 14px; color: var(--accent-ink);
  background: #fff; border-color: #c7c9f2;
}
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn.ghost.done { color: var(--ok); border-color: #a7f3d0; background: #ecfdf5; }

/* ------------------------------------------------------------ 结果与错误 */
.err {
  margin: 10px 0 0; font-size: 12.5px; color: var(--bad);
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px;
  padding: 8px 11px;
}
.err[hidden] { display: none; }

.result {
  margin-top: 16px; padding: 14px 15px;
  background: #f8f9fe; border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 10px;
}
.result[hidden] { display: none; }
.r-row { margin-bottom: 12px; }
.r-row:last-of-type { margin-bottom: 0; }
.r-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.r-row b {
  font: 600 15px var(--mono); color: var(--accent-ink);
  word-break: break-all;
}

.foot-note {
  margin: 26px 0 0; text-align: center;
  font-size: 12.5px; color: var(--muted); line-height: 1.9;
}

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 760px) {
  .page { padding: 24px 16px 36px; }
  h1 { font-size: 22px; }
  .cards { grid-template-columns: 1fr; }
  .now { flex-direction: column; gap: 14px; padding: 18px; }
  .now-item b { font-size: 17px; }
  .card { padding: 18px 16px; }
}
