:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-soft: #f0f1ec;
  --ink: #202321;
  --muted: #747a73;
  --line: #e5e8e1;
  --sage: #527568;
  --sage-dark: #355b50;
  --sage-light: #e8f0eb;
  --orange: #ea7850;
  --orange-light: #fff0e8;
  --shadow: 0 18px 55px rgba(35, 50, 42, .07);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; display: flex; }
.sidebar { width: 245px; flex: 0 0 245px; min-height: 100vh; background: #fff; border-right: 1px solid var(--line); padding: 29px 17px 20px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 34px; }
.brand-mark { width: 34px; height: 34px; background: var(--sage-dark); color: white; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 16px; letter-spacing: -2px; }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: -.3px; }
.brand-sub { display: block; color: #9b9f99; font-size: 10px; font-weight: 500; margin-top: 3px; letter-spacing: .4px; }
.nav-label { color: #a3a9a0; text-transform: uppercase; letter-spacing: 1.5px; font-size: 10px; font-weight: 700; padding: 0 13px 10px; }
.nav { display: grid; gap: 5px; }
.nav button { display: flex; align-items: center; gap: 12px; color: #737a72; border: 0; background: transparent; padding: 12px 13px; border-radius: 12px; text-align: left; font-size: 13px; transition: .2s; }
.nav button:hover { background: var(--surface-soft); color: var(--ink); }
.nav button.active { background: var(--sage-light); color: var(--sage-dark); font-weight: 700; }
.nav svg { width: 17px; height: 17px; stroke-width: 1.8; }
.sidebar-bottom { margin-top: auto; padding: 16px 13px 5px; border-top: 1px solid var(--line); }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #83b49a; box-shadow: 0 0 0 4px #ecf6ed; }
.main { flex: 1; min-width: 0; padding: 0 42px 70px; }
.topbar { height: 76px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.crumb { color: var(--muted); font-size: 12px; }
.crumb strong { color: var(--ink); font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.date-pill, .status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--muted); font-size: 11px; }
.status-pill { border-color: #d4e6d8; color: #4f8162; background: #f5fbf5; }
.page { max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: end; padding: 33px 0 23px; }
.eyebrow { color: var(--sage); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 800; margin-bottom: 9px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; letter-spacing: -1.3px; line-height: 1.15; }
h2 { font-size: 19px; letter-spacing: -.4px; }
h3 { font-size: 14px; }
.page-intro { color: var(--muted); margin-top: 9px; font-size: 13px; }
.date-big { color: var(--muted); font-size: 12px; text-align: right; line-height: 1.7; }
.date-big strong { display: block; color: var(--ink); font-size: 18px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr); gap: 17px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.insight-panel { min-height: 246px; padding: 25px 27px; background: linear-gradient(130deg, #e6f0eb 0%, #f9f7ef 100%); border: 1px solid #d9e7df; position: relative; overflow: hidden; }
.insight-panel:after { content: ""; position: absolute; width: 220px; height: 220px; border: 1px solid rgba(82,117,104,.16); border-radius: 50%; right: -76px; bottom: -125px; box-shadow: 0 0 0 22px rgba(82,117,104,.04), 0 0 0 45px rgba(82,117,104,.035); }
.insight-head { display: flex; align-items: center; justify-content: space-between; }
.insight-title { display: flex; gap: 10px; align-items: center; }
.spark { width: 27px; height: 27px; border-radius: 9px; background: var(--sage-dark); color: white; display: grid; place-items: center; }
.spark svg { width: 15px; }
.mini-link { border: 0; background: transparent; color: var(--sage-dark); font-size: 11px; font-weight: 700; padding: 5px; }
.source-line { margin-top: 7px; margin-left: 37px; color: #789084; font-size: 11px; }
.idea-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 13px; margin-top: 21px; position: relative; z-index: 1; }
.idea-item { border: 0; text-align: left; padding: 0; background: transparent; color: var(--ink); }
.idea-item:hover .idea-title { color: var(--sage-dark); text-decoration: underline; text-underline-offset: 3px; }
.idea-title { display: block; font-size: 12px; line-height: 1.45; font-weight: 700; }
.idea-meta { display: block; color: #89958c; font-size: 10px; margin-top: 3px; }
.weather-panel { padding: 25px 25px; min-height: 246px; display: flex; flex-direction: column; justify-content: space-between; }
.weather-top { display: flex; justify-content: space-between; }
.weather-label { color: var(--muted); font-size: 11px; }
.weather-city { font-size: 13px; font-weight: 700; margin-top: 6px; }
.weather-icon { color: var(--orange); }
.weather-icon svg { width: 32px; height: 32px; }
.temp { font-size: 45px; font-weight: 300; letter-spacing: -3px; margin-top: 3px; }
.temp span { font-size: 14px; letter-spacing: 0; color: var(--muted); margin-left: 4px; }
.weather-note { color: var(--muted); font-size: 11px; line-height: 1.7; }
.weather-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-flex; padding: 5px 8px; border-radius: 6px; color: var(--sage-dark); background: var(--sage-light); font-size: 10px; }
.workspace-layout { display: grid; grid-template-columns: 315px minmax(0, 1fr); gap: 17px; margin-top: 17px; align-items: start; }
.composer { padding: 23px 22px; position: sticky; top: 20px; }
.section-kicker { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
.section-kicker span { color: var(--muted); font-size: 10px; }
.field { margin-top: 19px; }
.field-label { display: flex; justify-content: space-between; color: #727970; font-size: 11px; margin-bottom: 9px; font-weight: 700; }
.field-label em { color: #a3aaa2; font-style: normal; font-weight: 500; }
.chip-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 7px 9px; color: #6b716a; font-size: 11px; transition: .18s; }
.chip:hover { border-color: #b5cfc3; color: var(--sage-dark); }
.chip.selected { color: var(--sage-dark); border-color: #9cbcad; background: var(--sage-light); font-weight: 700; }
.select-control, .text-control { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 10px 11px; outline: none; font-size: 12px; }
.select-control:focus, .text-control:focus { border-color: #91b8a8; box-shadow: 0 0 0 3px #edf5f0; }
.primary-btn, .secondary-btn, .ghost-btn { border: 0; border-radius: 9px; padding: 11px 15px; font-size: 12px; font-weight: 700; display: inline-flex; justify-content: center; align-items: center; gap: 8px; transition: .2s; }
.primary-btn { background: var(--sage-dark); color: white; box-shadow: 0 7px 16px rgba(53,91,80,.18); }
.primary-btn:hover { background: #294d44; transform: translateY(-1px); }
.secondary-btn { color: var(--sage-dark); background: var(--sage-light); }
.secondary-btn:hover { background: #d9e9e0; }
.ghost-btn { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.ghost-btn:hover { background: var(--surface-soft); color: var(--ink); }
.full-btn { width: 100%; margin-top: 24px; padding: 13px; }
.random-btn { width: 100%; margin-top: 9px; border: 1px dashed #abc4b5; color: var(--sage-dark); background: #fbfdfb; }
.random-btn:hover { background: var(--sage-light); }
.result-panel { min-width: 0; }
.result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.result-count { color: var(--muted); font-size: 11px; }
.result-block { padding: 22px 23px; margin-bottom: 13px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.block-title { display: flex; align-items: center; gap: 9px; }
.block-no { width: 23px; height: 23px; border-radius: 7px; background: var(--orange-light); color: var(--orange); display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.block-note { color: var(--muted); font-size: 10px; }
.title-row { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 12px 0; border-top: 1px solid #f0f1ed; }
.title-row:first-child { border-top: 0; }
.title-index { color: #b0b5af; font-size: 10px; }
.title-copy { min-width: 0; }
.title-text { font-size: 13px; line-height: 1.5; font-weight: 700; }
.title-type { display: inline-block; color: #8e9890; font-size: 10px; margin-top: 4px; }
.row-actions { display: flex; gap: 5px; opacity: .62; }
.row-actions button { border: 0; background: var(--surface-soft); color: #687169; border-radius: 6px; width: 29px; height: 27px; display: grid; place-items: center; }
.row-actions button:hover, .row-actions button.is-on { background: var(--orange-light); color: var(--orange); opacity: 1; }
.row-actions svg { width: 14px; height: 14px; }
.articles-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.article-card { padding: 20px; display: flex; flex-direction: column; min-height: 325px; }
.article-label { display: flex; justify-content: space-between; color: var(--sage-dark); font-size: 10px; font-weight: 800; letter-spacing: .6px; }
.article-card h3 { margin-top: 13px; font-size: 14px; }
.article-body { white-space: pre-line; color: #616861; font-size: 12px; line-height: 1.85; margin-top: 12px; flex: 1; }
.article-footer { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.article-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 13px; }
.article-tags span { color: var(--sage-dark); font-size: 10px; }
.article-actions { display: flex; gap: 7px; }
.article-actions button { flex: 1; }
.tag-block { padding: 20px 23px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.tag-block h3 { margin-bottom: 6px; }
.tag-block p { color: var(--muted); font-size: 11px; }
.tag-cloud { display: flex; gap: 7px; flex-wrap: wrap; justify-content: end; }
.tag-cloud .tag { font-size: 11px; background: #f7f5ef; color: #8e7058; }
.empty-state { border: 1px dashed #d1d8d0; border-radius: 13px; padding: 62px 22px; text-align: center; color: var(--muted); background: rgba(255,255,255,.45); }
.empty-state svg { width: 26px; color: #9db2a7; margin-bottom: 10px; }
.subpage-head { padding: 34px 0 24px; display: flex; justify-content: space-between; align-items: end; }
.toolbar { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.search-box { min-width: 240px; position: relative; }
.search-box svg { position: absolute; left: 11px; top: 10px; width: 15px; color: #99a099; }
.search-box input { padding-left: 32px; }
.library-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 17px; }
.stat-card { padding: 18px 19px; }
.stat-label { color: var(--muted); font-size: 11px; }
.stat-num { font-size: 27px; letter-spacing: -1px; margin-top: 8px; font-weight: 700; }
.stat-trend { color: #6b9a7d; font-size: 10px; margin-top: 5px; }
.library-table { overflow: hidden; }
.table-head, .table-row { display: grid; grid-template-columns: minmax(280px, 2fr) 110px 92px 95px 145px; gap: 14px; align-items: center; padding: 14px 19px; }
.table-head { background: #fafbf8; color: #9aa199; font-size: 10px; }
.table-row { border-top: 1px solid #f0f1ed; min-height: 67px; }
.table-title { font-size: 12px; font-weight: 700; line-height: 1.4; }
.table-meta { color: #99a099; font-size: 10px; margin-top: 5px; }
.metric { font-size: 12px; color: #5f675f; }
.metric strong { display: block; color: var(--ink); font-size: 13px; }
.table-actions { display: flex; justify-content: end; gap: 5px; }
.icon-btn { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: #7b837b; }
.icon-btn:hover, .icon-btn.is-on { color: var(--orange); background: var(--orange-light); border-color: #f5d8c9; }
.icon-btn svg { width: 14px; }
.filter-select { width: auto; min-width: 123px; }
.structure-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.structure-card { padding: 21px; min-height: 174px; position: relative; }
.structure-card .structure-type { color: var(--orange); font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.structure-card h3 { margin: 13px 0 9px; font-size: 15px; }
.structure-card p { color: #747d75; font-size: 12px; line-height: 1.7; }
.structure-card .usage { position: absolute; right: 19px; bottom: 19px; color: #abb1aa; font-size: 10px; }
.add-structure { border: 1px dashed #c9d3cb; background: transparent; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.add-structure:hover { background: #fbfcfa; border-color: #9db9a9; color: var(--sage-dark); }
.add-structure svg { width: 24px; margin-bottom: 7px; }
.database-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.data-card { padding: 23px; }
.data-card-head { display: flex; justify-content: space-between; align-items: start; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.data-card-head p { color: var(--muted); font-size: 11px; margin-top: 5px; }
.data-list { display: grid; gap: 0; }
.data-item { display: grid; grid-template-columns: 105px 1fr; gap: 13px; align-items: center; padding: 12px 0; border-bottom: 1px solid #f1f2ef; }
.data-item:last-child { border-bottom: 0; }
.data-item label { color: #838b82; font-size: 11px; }
.data-item input, .data-item textarea { border: 1px solid transparent; background: #f8f9f6; padding: 8px 9px; border-radius: 7px; color: var(--ink); font-size: 12px; outline: none; width: 100%; resize: vertical; }
.data-item input:focus, .data-item textarea:focus { border-color: #afc8ba; background: #fff; }
.save-bar { position: sticky; bottom: 18px; display: flex; justify-content: end; margin-top: 17px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(22,31,27,.32); display: grid; place-items: center; padding: 18px; z-index: 20; }
.modal { width: min(470px, 100%); background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.17); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-close { border: 0; background: transparent; color: var(--muted); }
.modal .field { margin-top: 16px; }
.modal textarea { min-height: 90px; }
.modal-actions { display: flex; justify-content: end; gap: 8px; margin-top: 20px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #24342e; color: #fff; padding: 11px 16px; border-radius: 9px; font-size: 12px; transition: .25s; box-shadow: 0 10px 25px rgba(0,0,0,.16); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-nav { display: none; }
@media (max-width: 1050px) {
  .main { padding: 0 24px 55px; }
  .sidebar { width: 220px; flex-basis: 220px; }
  .workspace-layout { grid-template-columns: 280px minmax(0, 1fr); }
  .articles-grid { grid-template-columns: 1fr; }
  .article-card { min-height: 0; }
  .table-head, .table-row { grid-template-columns: minmax(210px, 2fr) 75px 75px 80px 125px; gap: 9px; }
}
@media (max-width: 780px) {
  .shell { display: block; padding-bottom: 71px; }
  .sidebar { display: none; }
  .main { padding: 0 15px 35px; }
  .topbar { height: 62px; }
  .topbar .crumb { font-size: 11px; }
  .top-actions .date-pill { display: none; }
  .page-head, .subpage-head { padding: 25px 0 18px; align-items: start; }
  h1 { font-size: 26px; }
  .date-big { display: none; }
  .hero-grid, .workspace-layout, .database-grid { grid-template-columns: 1fr; }
  .insight-panel, .weather-panel { min-height: 0; }
  .weather-panel { gap: 18px; }
  .composer { position: static; }
  .result-head { margin-top: 8px; }
  .tag-block { display: block; }
  .tag-cloud { justify-content: start; margin-top: 15px; }
  .library-stats { grid-template-columns: repeat(2, 1fr); }
  .table-shell { overflow-x: auto; }
  .table-head, .table-row { min-width: 680px; }
  .structure-grid { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr); bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 8px 7px 9px; }
  .mobile-nav button { border: 0; background: transparent; color: #879087; font-size: 10px; display: grid; gap: 3px; justify-items: center; }
  .mobile-nav button.active { color: var(--sage-dark); font-weight: 700; }
  .mobile-nav svg { width: 18px; height: 18px; }
  .title-row { grid-template-columns: 23px minmax(0, 1fr) auto; }
  .row-actions { opacity: 1; }
}
