:root {
  --card-bg:#fff; --muted:#f7f7f8; --text:#111; --border:#e8e8e8; --accent:#111; --hi:#fff7d6;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color: var(--text); background:#fafafa; margin:0;
}

header { padding:32px 20px; text-align:center; }
header h1 { margin:0 0 8px; font-size:28px; }
header p { margin:0; color:#555; }

.container { max-width:1100px; margin:0 auto; padding:0 16px 40px; }

.grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
@media (max-width: 860px){ .grid{ grid-template-columns:1fr; } }

.card { background:var(--card-bg); border:1px solid var(--border); border-radius:12px; padding:18px; }
.card h2 { margin:0 0 12px; font-size:20px; }

.row { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:8px 0; }

label { font-size:14px; color:#333; }

input[type="date"], input[type="time"], input[type="number"] {
  border:1px solid var(--border); border-radius:8px; padding:8px 10px; font-size:15px; background:#fff;
}
input[type="number"]{ width:180px; }

button {
  border:1px solid var(--accent); background:var(--accent); color:#fff;
  border-radius:10px; padding:10px 14px; font-size:15px; cursor:pointer;
}
button.secondary { background:#fff; color:var(--accent); }

.result {
  margin-top:14px; line-height:1.35;
  background:var(--hi); border:1px solid #f0e4a6; border-radius:12px;
  padding:14px 16px; box-shadow:0 2px 10px rgba(0,0,0,.05);
  min-height: 3.6em; /* keep height stable */
}

.muted { background:var(--muted); border-radius:10px; padding:12px; font-size:14px; color:#444; }
.howto { margin-top:16px; }

.small { font-size:12px; color:#666; }
.tip { font-size:13px; color:#555; margin-top:6px; }

.ol-indent { margin:8px 0 0 18px; }
.ul-indent { margin:8px 0 0 18px; }

/* Left result: fixed two-line layout */
.age-wrap { display:flex; flex-direction:column; gap:4px; white-space:nowrap; }
.age-line1 { font-size:22px; font-weight:700; }
.age-time {
  font-size:26px; font-weight:800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums; letter-spacing:.5px;
}

/* Right result: unified bold style */
.date-wrap { display:flex; flex-direction:column; gap:4px; white-space:nowrap; }
.date-main { font-size:26px; font-weight:800; }
.date-sub  { font-size:14px; color:#555; }

/* Make header a positioning context */
header{
  position: relative;
}

/* Language picker pinned in header, doesn't take layout space */
.lang-picker{
  position: absolute;
  top: 16px;
  left: 16px;

  display: flex;
  align-items: center;
  gap: 8px;

  margin: 0;            /* 防止顶开标题 */
  padding: 0;
}

/* Keep globe perfectly centered with the select */
#langSelect{
  font: inherit;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.18);
  background: rgba(255,255,255,.9);
  line-height: 38px;
}

.lang-icon{
  height: 38px;
  width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  opacity: .85;
}

.lang-icon svg{
  display: block;
}

/* Optional: ensure header content doesn't collide with picker on small screens */
@media (max-width: 520px){
  header{ padding-top: 64px; }  /* 给标题留出空间，避免覆盖 */
}

/* A11y helper */
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.faq-wrap{
  display: flex;
  justify-content: center;
  padding: 0 16px;      /* 小屏左右留点边距 */
}

.faq-section{
  width: 100%;
  max-width: 920px;     /* 居中宽度 */
  text-align: left;
}

/* 一行：Date + Time 两列，列宽自适应 */
.row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 两列均分 */
  gap: 14px 18px;
  align-items: start;
}

/* 每个字段：label 在上，input 在下 */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0; /* 防止溢出导致布局崩 */
}

.field label {
  white-space: normal;   /* 允许长文本换行 */
  line-height: 1.2;
}

/* 小屏自动变 1 列 */
@media (max-width: 640px) {
  .row-2col {
    grid-template-columns: 1fr;
  }
}
