:root {
  --ink: #15221d;
  --muted: #65726b;
  --paper: #f4f1e8;
  --card: #fffdf6;
  --green: #174c3c;
  --gold: #c49a55;
  --line: #dcd5c5;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); background:
  radial-gradient(circle at 80% 10%, #e7d9b7 0, transparent 26%),
  linear-gradient(135deg, #f6f2e9, #ece7dc);
  font-family: "Microsoft YaHei", system-ui, sans-serif; min-height: 100vh;
}
button, input { font: inherit; }
button { cursor: pointer; border: 0; }
.hidden { display: none !important; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px clamp(22px, 5vw, 72px); background: var(--ink); color: #fff;
  border-bottom: 4px solid var(--gold);
}
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(26px, 4vw, 44px); letter-spacing: .08em; }
.eyebrow { color: var(--gold); letter-spacing: .18em; font-size: 12px; font-weight: 700; }
.user-box { display: flex; gap: 12px; align-items: center; }
.ghost { color: white; background: transparent; border: 1px solid #ffffff55; padding: 8px 14px; border-radius: 8px; }
main { padding: 30px clamp(18px, 5vw, 72px) 60px; }
.login-panel {
  max-width: 980px; margin: 7vh auto; display: grid; grid-template-columns: 1.2fr 1fr;
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 24px 70px #24312820;
}
.login-copy { padding: 58px; background: var(--green); color: white; }
.login-copy h2 { font-size: 40px; }
.login-copy p { line-height: 1.9; color: #dce9e3; }
.login-form { padding: 58px 42px; display: grid; gap: 15px; align-content: center; }
input { width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.login-form button, .primary {
  background: var(--green); color: white; padding: 14px 18px; border-radius: 8px; font-weight: 700;
}
.message { color: #a43d31; min-height: 1.2em; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.module-card {
  min-height: 120px; padding: 20px; text-align: left; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.module-card.active { color: white; background: var(--green); border-color: var(--green); }
.module-card span { display: block; color: var(--gold); font-size: 26px; margin-bottom: 8px; }
.module-card small { display: block; color: var(--muted); margin-top: 8px; }
.module-card.active small { color: #dce9e3; }
.workspace { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.side-menu, .content-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; min-height: 470px; }
.menu-button { width: 100%; padding: 12px; text-align: left; background: transparent; border-bottom: 1px solid var(--line); }
.menu-button:hover { color: var(--green); }
.hero-card { padding: clamp(20px, 4vw, 48px); background: #f0eadb; border-left: 5px solid var(--gold); }
.task-row { display: grid; grid-template-columns: 34px 100px 1fr; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: start; }
.task-row input { width: 20px; height: 20px; }
.status-pill { display: inline-block; padding: 4px 8px; border-radius: 99px; background: #eadfc4; font-size: 12px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0 28px; }
.admin-tile { padding: 18px; background: #f0eadb; border: 1px solid var(--line); border-radius: 10px; }
.admin-tile strong { display: block; font-size: 26px; color: var(--green); margin-top: 8px; }
.module-admin-row { display: grid; grid-template-columns: 1fr 160px; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.module-admin-row select { padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.toolbar { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.knowledge-hero { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:28px; background:linear-gradient(135deg,#f0eadb,#e7dcc1); border-left:5px solid var(--gold); }
.knowledge-search { display:grid; grid-template-columns:1fr auto; gap:10px; margin:18px 0; }
.knowledge-search input, .knowledge-create input, .knowledge-create textarea, .knowledge-detail input, .knowledge-detail textarea { width:100%; box-sizing:border-box; padding:12px; border:1px solid var(--line); border-radius:8px; background:#fff; font:inherit; }
.knowledge-layout { display:grid; grid-template-columns:180px 1fr; gap:20px; }
.knowledge-facets { border-right:1px solid var(--line); padding-right:16px; }
.knowledge-facets > button { display:flex; justify-content:space-between; width:100%; padding:8px 0; background:transparent; text-align:left; }
.knowledge-facets h3 { margin-top:20px; }
.knowledge-list { display:grid; gap:12px; }
.knowledge-card { display:grid; grid-template-columns:auto 1fr; gap:6px 12px; padding:16px; text-align:left; background:#fff; border:1px solid var(--line); border-radius:10px; }
.knowledge-card:hover { border-color:var(--gold); transform:translateY(-1px); }
.knowledge-card strong,.knowledge-card p,.knowledge-card .knowledge-tags { grid-column:2; }
.knowledge-card small { grid-column:2; color:#746b5d; }
.knowledge-card p { margin:4px 0; color:#4d473f; }
.knowledge-type { grid-row:1 / span 3; align-self:start; padding:5px 7px; border-radius:6px; background:#f0eadb; font-size:11px; }
.knowledge-tags { display:flex; gap:6px; flex-wrap:wrap; }
.knowledge-tag { border:0; border-radius:99px; padding:4px 8px; background:#e8f0e9; color:var(--green); font-size:12px; }
.knowledge-tag.suggested { background:#fff1cb; color:#80601d; border:1px dashed #cba455; }
.knowledge-create { margin-bottom:22px; padding:20px; background:#f7f3e9; border:1px solid var(--line); border-radius:12px; }
.knowledge-create form { display:grid; gap:10px; margin-top:12px; }
.knowledge-create select { padding:10px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.knowledge-tabs { display:flex; gap:8px; }
.knowledge-tabs button { padding:7px 12px; border-radius:99px; background:#fff; }
.knowledge-tabs button.active { background:var(--green); color:#fff; }
.drop-zone { padding:28px; text-align:center; border:2px dashed var(--line); border-radius:10px; background:#fff; }
.drop-zone.dragging { border-color:var(--gold); background:#fff9e8; }
.drop-zone input { margin-top:12px; }
.knowledge-detail { display:grid; gap:14px; padding:24px; background:#f7f3e9; border:1px solid var(--line); border-radius:12px; }
.knowledge-detail > input { font-size:26px; font-weight:700; }
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.danger { background:#9d3128; color:#fff; }
.danger.compact { padding:7px 10px; font-size:12px; }
.back-button { margin-bottom:14px; }
.empty-state { padding:40px; text-align:center; border:1px dashed var(--line); color:#746b5d; }
.attachment-row { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; padding:12px 0; border-bottom:1px solid var(--line); }
.attachment-row small { display:block; margin-top:5px; color:#746b5d; }
.attachment-actions { display:flex; gap:6px; }
.compact-drop { display:block; margin:14px 0 8px; padding:14px; }
.relation-row { display:grid; grid-template-columns:auto 1fr; gap:10px; padding:9px 0; border-bottom:1px solid var(--line); }
.relation-row input { width:18px; height:18px; }
.relation-row small { display:block; color:#746b5d; }
.extracted-content { max-height:300px; overflow:auto; white-space:pre-wrap; padding:14px; background:#fff; border:1px solid var(--line); border-radius:8px; }
.web-cover { display:block; max-width:100%; max-height:280px; object-fit:cover; border-radius:10px; }
.web-source { color:#746b5d; }
.reminder-toolbar { margin-top:8px; }
@media (max-width: 720px) {
  .login-panel { grid-template-columns: 1fr; }
  .login-copy, .login-form { padding: 32px; }
  .workspace { grid-template-columns: 1fr; }
  .side-menu { min-height: auto; }
  .module-admin-row { grid-template-columns: 1fr; }
  .knowledge-hero { align-items:flex-start; flex-direction:column; }
  .knowledge-layout { grid-template-columns:1fr; }
  .knowledge-facets { border-right:0; border-bottom:1px solid var(--line); padding:0 0 14px; }
  .detail-grid { grid-template-columns:1fr; }
  .attachment-row { grid-template-columns:1fr; }
}
