/* ============ 穿搭灵感工作台 · 样式（视觉规范：奶油白底 + 深色侧栏 + 低饱和粉黄蓝绿卡片） ============ */
:root {
  --bg: #F7F7F5;
  --card: #FFFFFF;
  --text: #202124;
  --text-2: #6F7277;
  --border: #E6E7E4;
  --accent: #2F6B57;
  --accent-soft: #E7F0EC;
  --yellow: #F4D85A;
  --pink: #E9A8CF;
  --blue: #AFC9EA;
  --green: #B8CB9A;
  --yellow-soft: #FBF3D2;
  --pink-soft: #FAEBF3;
  --blue-soft: #EAF1FA;
  --green-soft: #EFF4E6;
  --sidebar: #1E1F22;
  --sidebar-text: #C9CBCF;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(32,33,36,.06);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.7; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--text); }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }

/* ---------- 布局骨架 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
  padding: 20px 14px;
}
.brand { color: #fff; padding: 6px 10px 18px; border-bottom: 1px solid #33353a; margin-bottom: 14px; }
.brand .logo { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.brand .sub { font-size: 12px; color: #8B8E94; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; margin: 2px 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--sidebar-text); font-size: 15px; text-align: left;
}
.nav-item:hover { background: #2a2c30; color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: #6E7176; padding: 0 10px; }

.main { flex: 1; margin-left: 232px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(247,247,245,.94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 12px 28px;
}
.topbar .page-title { font-size: 17px; font-weight: 700; }
.searchbox { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.searchbox input {
  width: 100%; padding: 9px 14px 9px 38px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; outline: none;
}
.searchbox input:focus { border-color: var(--accent); }
.searchbox .icon-search { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(32,33,36,.12);
  max-height: 340px; overflow-y: auto; display: none;
}
.search-results.open { display: block; }
.search-results .sr-item { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.search-results .sr-item:last-child { border-bottom: 0; }
.search-results .sr-item:hover { background: var(--bg); }
.search-results .sr-title { font-weight: 600; font-size: 14px; }
.search-results .sr-meta { font-size: 12px; color: var(--text-2); }
.search-results .sr-empty { padding: 14px; color: var(--text-2); font-size: 13px; text-align: center; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; min-width: 38px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--text); padding: 0 10px; font-size: 14px;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.content { padding: 26px 28px 60px; max-width: 1080px; width: 100%; margin: 0 auto; }

/* ---------- 帮助问号 ---------- */
.help-dot { display: inline-flex; }
.help-btn {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--text-2);
  background: #fff; color: var(--text-2); font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1;
  position: relative;
}
.help-btn:hover { border-color: var(--accent); color: var(--accent); }
.help-tip { position: relative; }
.help-tip .tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 264px; background: var(--sidebar); color: #E8E9EB; font-size: 13px; line-height: 1.6;
  padding: 10px 12px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  opacity: 0; visibility: hidden; transition: .15s; z-index: 60; font-weight: 400; text-align: left;
}
.help-tip:hover .tip { opacity: 1; visibility: visible; }
.section-head { display: flex; align-items: center; gap: 8px; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.section { margin-bottom: 26px; }
.section > .section-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.section > .section-desc { color: var(--text-2); font-size: 13.5px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 10px; border: 1px solid transparent; font-size: 15px; font-weight: 600;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #275A49; }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: #fff; border-color: #E8B4B4; color: #A33A3A; }
.btn-danger:hover { background: #FBF0F0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; background: var(--bg); border: 1px solid var(--border); color: var(--text-2); }
.kw { color: var(--text-2); font-size: 13px; }
.tag-color-pink { background: var(--pink-soft); border-color: #F0CBE1; color: #9C5378; }
.tag-color-blue { background: var(--blue-soft); border-color: #CBDCF0; color: #4A6C93; }
.tag-color-green { background: var(--green-soft); border-color: #D2DEBE; color: #5B703C; }
.tag-color-yellow { background: var(--yellow-soft); border-color: #EBDDA2; color: #8F7A1F; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.muted { color: var(--text-2); font-size: 13.5px; }
.hl { color: var(--accent); font-weight: 600; }

/* 风格卡片 */
.style-card { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.style-card .sc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.style-card h4 { font-size: 16px; font-weight: 700; }
.style-card p { font-size: 14px; }
.style-card .sc-rows { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.style-card .sc-rows b { color: var(--accent); font-weight: 600; margin-right: 6px; }

/* 表格化规则 */
.rule-table { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.rule-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.rule-row:nth-last-child(-n+2) { border-bottom: 0; }
.rule-row .from { font-weight: 600; font-size: 14px; }
.rule-row .arrow { color: var(--text-2); }
.rule-row .to { color: var(--accent); font-weight: 600; font-size: 14px; }

/* 记一条 */
.note-form textarea { width: 100%; min-height: 96px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; resize: vertical; outline: none; background: #fff; }
.note-form textarea:focus { border-color: var(--accent); }
.note-form .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.note-form select, .note-form input {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; outline: none;
}
.note-form select:focus, .note-form input:focus { border-color: var(--accent); }
.note-item { display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.note-item:last-child { border-bottom: 0; }
.note-item .n-body { flex: 1; min-width: 0; }
.note-item .n-text { white-space: pre-wrap; word-break: break-word; }
.note-item .n-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.note-item .n-actions button { background: none; border: none; color: var(--text-2); font-size: 13px; padding: 2px 4px; }
.note-item .n-actions button:hover { color: #A33A3A; }
.suggest { font-size: 13px; color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 6px 10px; display: none; }
.suggest.show { display: inline-flex; align-items: center; gap: 6px; }

/* 更多搭配 tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border); background: #fff;
  font-size: 14.5px; font-weight: 600; color: var(--text-2);
}
.tab:hover { border-color: var(--accent); color: var(--accent); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.subtab { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: 13.5px; color: var(--text-2); }
.subtab.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* 温度区间 */
.temp-row { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: #fff; }
.temp-row:last-child { border-bottom: 0; }
.temp-row .t-range { font-weight: 700; font-size: 15px; color: var(--accent); display: flex; align-items: baseline; gap: 6px; }
.temp-row .t-bar { height: 6px; border-radius: 999px; background: var(--bg); margin-top: 6px; overflow: hidden; }
.temp-row .t-bar i { display: block; height: 100%; border-radius: 999px; }
.temp-row .t-outfit { font-size: 14.5px; }
.temp-row .t-tip { font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* 体型 */
.body-card { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; }
.body-card .bc-head { padding: 14px 18px; display: flex; align-items: baseline; gap: 10px; }
.body-card .bc-head h4 { font-size: 16px; font-weight: 700; }
.body-card .bc-head .aka { font-size: 12.5px; color: var(--text-2); }
.body-card .bc-head .judge { margin-left: auto; font-size: 12.5px; color: var(--text-2); text-align: right; }
.body-card .bc-body { padding: 0 18px 16px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.body-card .bc-body b { color: var(--accent); margin-right: 6px; font-weight: 600; }
.calc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.calc label { font-size: 13px; color: var(--text-2); display: block; margin-bottom: 4px; }
.calc input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; outline: none; }
.calc input:focus { border-color: var(--accent); }
.calc-result { margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; display: none; }
.calc-result.show { display: block; }

/* 色卡 */
.palette-row { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.palette-row:last-child { border-bottom: 0; }
.palette-row .p-label { font-weight: 700; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.sw { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 12.5px; }
.sw i { width: 18px; height: 18px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.08); }


/* 设置抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(30,31,34,.45); z-index: 80; display: none; }
.drawer-mask.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 92vw); background: #fff; z-index: 90;
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column;
  box-shadow: -8px 0 30px rgba(0,0,0,.15);
}
.drawer.open { transform: translateX(0); }
.drawer .d-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer .d-head h3 { font-size: 17px; }
.drawer .d-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer h4 { font-size: 15px; margin: 18px 0 8px; }
.drawer h4:first-child { margin-top: 0; }
.drawer p, .drawer li { font-size: 14px; }
.drawer ul { padding-left: 20px; }
.drawer li { margin-bottom: 6px; }
.log-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.log-item .l-date { font-weight: 700; font-size: 14px; }
.log-item .l-ver { color: var(--accent); font-size: 12.5px; margin-left: 8px; }
.log-item ul { margin-top: 6px; }
.log-item .l-impact { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(30,31,34,.45); z-index: 95; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.open { display: flex; }
.modal { background: #fff; border-radius: 14px; max-width: 420px; width: 100%; padding: 22px; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal h4 { font-size: 16px; margin-bottom: 8px; }
.modal .m-body { font-size: 14px; color: var(--text-2); line-height: 1.7; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: var(--sidebar); color: #fff; padding: 10px 20px; border-radius: 10px; font-size: 14px; opacity: 0; transition: .25s; z-index: 120; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 空状态 */
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty svg { margin: 0 auto 10px; opacity: .5; }
.empty .e-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }

/* ============ 手机端 ============ */
.m-topbar { display: none; }
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { display: none; }
  .m-topbar {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    position: sticky; top: 0; z-index: 30; background: rgba(247,247,245,.95); backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
  }
  .m-topbar .page-title { font-size: 16.5px; font-weight: 700; flex: 1; }
  .m-topbar .searchbox { flex: 1.6; max-width: none; }
  .m-topbar .searchbox input { padding: 8px 10px 8px 34px; font-size: 14px; }
  .content { padding: 18px 16px 96px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .rule-table { grid-template-columns: 1fr; }
  .rule-row { border-bottom: 1px solid var(--border); }
  .rule-row:last-child { border-bottom: 0; }
  .calc { grid-template-columns: 1fr 1fr; }
  .temp-row { grid-template-columns: 96px 1fr; }
  .body-card .bc-head { flex-wrap: wrap; }
  .body-card .bc-head .judge { margin-left: 0; text-align: left; width: 100%; }
  .help-tip .tip { display: none; } /* 手机端点击用弹窗 */
  .help-btn { width: 32px; height: 32px; font-size: 13px; }
  .help-btn::after { content: ""; position: absolute; inset: -7px; } /* 手机端扩大为 46px 触控区 */
  .btn { min-height: 44px; }
  .tab { min-height: 44px; }
  .icon-btn { height: 44px; min-width: 44px; }
  .subtab { min-height: 38px; }
  .note-form select, .note-form input { min-height: 44px; }

  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid var(--border); z-index: 50;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .bottom-nav .bn-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: none; color: var(--text-2); font-size: 11.5px; padding: 6px 0; min-height: 52px;
  }
  .bottom-nav .bn-item.active { color: var(--accent); font-weight: 600; }
  .bottom-nav .bn-item:active { background: var(--bg); }
  .help-tip .tip { position: fixed; }
}
@media (max-width: 400px) {
  .calc { grid-template-columns: 1fr; }
}
