/* 酿酒之星 · 配方设计
   跟门户同一套配色（深底 + 青色点缀），这样从首页点进来不像跳到了别的网站。
   纯静态、零依赖，没有构建步骤。 */

:root {
  --bg: #0a0d10;
  --card: #101820;
  --card2: #0d141b;
  --line: rgba(24, 224, 255, 0.14);
  --line-strong: rgba(24, 224, 255, 0.32);
  --cyan: #18e0ff;
  --cyan-dim: #7fe6f7;
  --amber: #ffb242;
  --green: #07c160;
  --red: #ff6b6b;
  --text: #e7eef3;
  --muted: #8d9aa5;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
b, strong { color: #fff; font-weight: 600; }

.wrap { width: min(1180px, 94vw); margin: 0 auto; }

/* ============ 顶栏 ============ */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10, 13, 16, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(24, 224, 255, 0.9), rgba(24, 224, 255, 0.35));
  color: #04202a; font-weight: 800; font-size: 17px;
  box-shadow: 0 0 20px rgba(24, 224, 255, 0.32);
}
.brand-text { font-size: 16px; font-weight: 700; letter-spacing: 0.4px; }
.brand-text em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.nav-links { display: flex; gap: 22px; font-size: 13px; color: #c4ced6; }
.nav-links a:hover { color: var(--cyan); }

/* ============ 页头 ============ */
.page { padding: 26px 0 60px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 26px; letter-spacing: 0.5px; }
.lead { margin-top: 8px; color: var(--muted); max-width: 760px; }
.lead b { color: var(--cyan-dim); }

/* ============ 布局 ============ */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.edit { display: flex; flex-direction: column; gap: 14px; }
.result { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 78px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.card h2 { font-size: 15px; letter-spacing: 0.5px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card > h2 { margin-bottom: 12px; }

.hint { font-size: 12px; color: var(--muted); line-height: 1.75; margin-top: 10px; }
.sum { font-size: 12px; color: var(--cyan-dim); margin-top: 10px; }

/* ============ 批次参数 ============ */
.grid-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 12px; }
.grid-params label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.unit { color: #6f7c86; }

input[type="number"], select, input[type="text"] {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--card2); border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 10px; appearance: none;
}
input[type="number"]:focus, select:focus { outline: none; border-color: var(--line-strong); }
select { cursor: pointer; }
select option { background: #0d141b; color: var(--text); }

/* ============ 配方行 ============ */
.rows { display: flex; flex-direction: column; gap: 8px; }

/* 麦芽行：下拉 + 用量 + 删 */
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) 118px 28px;
  gap: 8px; align-items: center;
}
/* 酒花行字段多，用 flex 换行，窄屏也不会挤成一团 */
.hop-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hop-row .hop-sel { flex: 1 1 190px; min-width: 150px; }
.row-yeast { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-yeast select { flex: 1 1 240px; }

/* 带单位的小输入框：单位跟在数字后面，短一点不占地方 */
.mini-field { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #6f7c86; }
.mini-field input { width: 72px; padding: 7px 8px; }

.btn-mini {
  font-family: inherit; font-size: 12px; cursor: pointer;
  background: rgba(24, 224, 255, 0.08); color: var(--cyan-dim);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px;
}
.btn-mini:hover { background: rgba(24, 224, 255, 0.16); color: #fff; }

.btn-del {
  font-family: inherit; font-size: 16px; line-height: 1; cursor: pointer;
  background: none; border: 0; color: #5b6771; padding: 4px;
}
.btn-del:hover { color: var(--red); }

/* ============ 结果面板 ============ */
.heads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.heads + .heads { margin-top: 10px; }
.head-item {
  background: var(--card2); border: 1px solid var(--line);
  border-radius: 11px; padding: 10px 12px; position: relative; min-height: 84px;
}
.head-item .k { display: block; font-size: 11px; color: var(--muted); }
.head-item b {
  display: block; font-size: 23px; font-weight: 700; line-height: 1.25; margin-top: 3px;
  font-variant-numeric: tabular-nums; color: #fff;
}
.head-item .v { font-size: 11px; color: var(--muted); }
.swatch {
  position: absolute; right: 10px; top: 10px;
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #222;
}

.water { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.water h3 { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.water-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; }
.water-grid div {
  display: flex; align-items: baseline; justify-content: space-between;
  background: var(--card2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px;
}
.water-grid span { font-size: 12px; color: var(--muted); }
.water-grid b { font-size: 15px; font-variant-numeric: tabular-nums; }

.msgs { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.msg { font-size: 12px; line-height: 1.7; padding-left: 16px; position: relative; }
.msg::before { position: absolute; left: 0; top: 0; }
.msg-warn { color: var(--amber); }
.msg-warn::before { content: '!'; font-weight: 700; }
.msg-note { color: var(--muted); }
.msg-note::before { content: '·'; }

/* ============ 风味标签 ============ */
.flavor-box { display: flex; flex-wrap: wrap; gap: 6px; }
.flavor-tag {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 178, 66, 0.10); border: 1px solid rgba(255, 178, 66, 0.28);
  color: var(--amber);
}
.flavor-tag.muted { background: rgba(255, 255, 255, 0.04); border-color: var(--line); color: var(--muted); }

/* ============ 保存区 ============ */
.save-card { display: flex; flex-direction: column; gap: 9px; }
.btn-primary, .btn-line {
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
}
.btn-primary { background: linear-gradient(135deg, #24e6ff, #0aa8c9); color: #03222b; }
.btn-line { background: none; border-color: var(--line-strong); color: var(--cyan-dim); }
.btn-primary:disabled, .btn-line:disabled { opacity: 0.42; cursor: not-allowed; }
.btn-primary:not(:disabled):hover, .btn-line:not(:disabled):hover { filter: brightness(1.08); }

.src-note { font-size: 11px; color: #6f7c86; line-height: 1.8; }

/* ============ 窄屏 ============ */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .result { position: static; }
  .heads { grid-template-columns: repeat(2, 1fr); }
}
