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

:root {
  --bg: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-tertiary: #0f3460;
  --text: #e0e0e0;
  --text-muted: #a0a0a0;
  --accent: #e94560;
  --accent-hover: #ff6b81;
  --border: #2a2a4a;
  --success: #4ecdc4;
  --danger: #e94560;
  --sidebar-width: 300px;
}

/* 内容收件箱与桌面下载 */
.desktop-download{text-decoration:none;text-align:center}.clip-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}.clip-actions .btn{min-width:0}
#inbox-count{display:inline-block;min-width:18px;padding:1px 5px;border-radius:999px;background:var(--primary);color:#fff;font-size:10px}
.inbox-modal{max-height:92vh}.inbox-form{display:grid;gap:9px}.inbox-fields{display:grid;grid-template-columns:1fr 1fr;gap:9px}.inbox-list{display:grid;gap:9px;max-height:330px;overflow:auto;margin-top:12px}.inbox-card{border:1px solid var(--border);border-radius:9px;padding:11px;background:var(--bg-tertiary)}
.inbox-card-head{display:flex;justify-content:space-between;gap:10px}.inbox-card-head span{color:var(--text-muted);font-size:12px}.inbox-card>a{display:block;color:var(--primary-light);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:7px}.inbox-card p{font-size:13px;color:var(--text-secondary);line-height:1.5;margin:8px 0}.inbox-card-actions{display:flex;justify-content:flex-end;gap:7px}
@media(max-width:600px){.inbox-fields{grid-template-columns:1fr}.inbox-modal{width:100%;height:100%;max-height:none;border-radius:0}.inbox-list{max-height:none}.clip-actions{grid-template-columns:1fr 1fr!important}}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 4px;
}

.sidebar-header .subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-actions {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
}

.search-box {
  padding: 0 16px 12px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
}

.tags-cloud {
  padding: 0 16px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 60px;
  overflow-y: auto;
}

.tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.tag:hover, .tag.active {
  background: var(--accent);
  color: #fff;
}

.note-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 0 8px 8px;
}

.note-list li {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.15s;
}

.note-list li:hover {
  background: var(--bg-tertiary);
}

.note-list li.active {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent);
}

.note-list li .note-item-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-list li .note-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* 主内容区 */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  gap: 12px;
}

.note-title-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  outline: none;
}

.note-title-input:focus {
  border-color: var(--accent);
}

.toolbar-actions {
  display: flex;
  gap: 6px;
}

/* 编辑器区域 */
.editor-area {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
}

.welcome-screen h2 {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 8px;
}

.welcome-screen .hint {
  margin-top: 16px;
  font-size: 14px;
}

.note-editor {
  width: 100%;
  height: 100%;
  padding: 20px;
  border: none;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  resize: none;
  outline: none;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.note-preview {
  padding: 20px;
  overflow-y: auto;
  height: 100%;
  line-height: 1.8;
  font-size: 15px;
}

.note-preview h1 { font-size: 24px; margin: 16px 0 8px; color: var(--accent); }
.note-preview h2 { font-size: 20px; margin: 14px 0 6px; }
.note-preview h3 { font-size: 17px; margin: 12px 0 4px; }
.note-preview p { margin: 8px 0; }
.note-preview code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 13px;
}
.note-preview pre {
  background: var(--bg-secondary);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 12px 0;
}
.note-preview pre code { background: none; padding: 0; }
.note-preview blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 12px 0;
  color: var(--text-muted);
}
.note-preview ul, .note-preview ol { padding-left: 24px; margin: 8px 0; }
.note-preview a { color: var(--accent); text-decoration: none; }
.note-preview a:hover { text-decoration: underline; }
.note-preview .wiki-link {
  color: var(--success);
  cursor: pointer;
}
.note-preview .wiki-link:hover { text-decoration: underline; }
.note-preview .tag-inline {
  color: var(--accent-hover);
  font-weight: 500;
}

/* 分栏视图 */
.split-view {
  display: none;
  flex: 1;
  overflow: hidden;
}

.split-view.active {
  display: flex;
}

.split-view .note-editor {
  width: 50%;
  border-right: 1px solid var(--border);
}

.split-view .note-preview {
  width: 50%;
}

/* 状态栏 */
.status-bar {
  padding: 6px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

#save-status.saved { color: var(--success); }
#save-status.saving { color: var(--accent); }

/* 按钮 */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.85;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* 响应式 */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .split-view.active {
    flex-direction: column;
  }
  .split-view .note-editor,
  .split-view .note-preview {
    width: 100%;
    height: 50%;
  }
}

/* 收录工具栏 */
.clip-actions {
  padding: 0 16px 8px;
  display: flex;
  gap: 6px;
}

.btn-clip {
  flex: 1;
  padding: 6px 4px;
  font-size: 11px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-clip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-wide {
  max-width: 640px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 16px;
  color: var(--accent);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}

.modal-input:focus { border-color: var(--accent); }

.modal-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 导入区域 */
.import-textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  resize: vertical;
  outline: none;
  margin-bottom: 12px;
}

.import-textarea:focus { border-color: var(--accent); }

.import-file-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.import-file-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* 抓取管理 */
.crawl-add {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.crawl-add h4, .crawl-list-header h4 {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
}

.crawl-cron-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cron-input { flex: 1; }

.cron-hint {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.cron-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cron-preset {
  font-size: 11px;
  padding: 4px 10px;
}

.crawl-job-list {
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
}

.crawl-job-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
  background: var(--bg);
}

.crawl-job-info {
  flex: 1;
  min-width: 0;
}

.crawl-job-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crawl-job-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.crawl-job-actions {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.crawl-job-actions .btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

.job-enabled { color: var(--success); }
.job-disabled { color: var(--text-muted); }

/* Toast 提示 */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show { opacity: 1; }
.toast.success { background: var(--success); color: #000; }
.toast.error { background: var(--danger); color: #fff; }
.toast.info { background: var(--bg-tertiary); color: var(--text); }

/* 登录页 */
.login-page {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.login-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-box h1 {
  font-size: 24px;
  color: var(--accent);
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
  -webkit-appearance: none;
}

.login-input:focus { border-color: var(--accent); }

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  margin-top: 8px;
  border-radius: 8px;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

/* 汉堡菜单按钮 */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 500;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

/* 侧边栏底部 */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* 手机端适配增强 */
@media (max-width: 768px) {
  .hamburger-btn { display: block; }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 400;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 280px;
    min-width: 280px;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content {
    padding-top: 50px;
  }

  .editor-toolbar {
    flex-wrap: wrap;
    padding: 8px 12px;
  }

  .note-title-input {
    font-size: 14px;
    min-width: 100%;
    margin-bottom: 8px;
  }

  .clip-actions {
    flex-wrap: wrap;
  }

  .btn-clip {
    font-size: 12px;
    padding: 8px 4px;
  }
}


/* ===== V1.3 视觉系统与多端适配 ===== */
:root {
  color-scheme: dark;
  --bg: #08111f;
  --bg-secondary: #0d1a2b;
  --bg-tertiary: #13263a;
  --surface: #102035;
  --surface-hover: #172d45;
  --text: #eef5fb;
  --text-secondary: #c1cfdd;
  --text-muted: #8294a8;
  --accent: #35c49a;
  --accent-hover: #53d8b1;
  --accent-soft: rgba(53, 196, 154, .13);
  --primary: #35c49a;
  --primary-light: #76e0c1;
  --border: #21364b;
  --success: #35c49a;
  --danger: #f26978;
  --shadow: 0 18px 55px rgba(0, 0, 0, .28);
  --sidebar-width: 312px;
}
body {
  background:
    radial-gradient(circle at 75% 12%, rgba(34, 116, 157, .12), transparent 28%),
    var(--bg);
  letter-spacing: .01em;
}
button, input, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(53, 196, 154, .28);
  outline-offset: 2px;
}
.sidebar {
  background: linear-gradient(180deg, #0f2033 0%, #0b1727 100%);
  box-shadow: 12px 0 40px rgba(0,0,0,.14);
}
.sidebar-header { padding: 20px 18px 14px; }
.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 12px; color: #06251d; font-weight: 900; font-size: 19px;
  background: linear-gradient(145deg, #79e6c5, #2db88e);
  box-shadow: 0 8px 24px rgba(53,196,154,.22);
}
.sidebar-header h1 { color: var(--text); font-size: 17px; margin-bottom: 2px; }
.sync-state { margin-top: 12px; color: var(--text-muted); font-size: 11px; display:flex; align-items:center; gap:7px; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--accent-soft); }
.sidebar-actions { padding-top: 14px; }
.clip-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0,1fr)) !important; padding-bottom: 12px; }
.btn {
  min-height: 38px; border: 1px solid transparent; border-radius: 9px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, #35c49a, #239b78); color: #041b15; box-shadow: 0 7px 18px rgba(53,196,154,.15); }
.btn-secondary, .btn-clip { background: rgba(255,255,255,.035); border-color: var(--border); color: var(--text-secondary); }
.btn-secondary:hover, .btn-clip:hover { background: var(--surface-hover); color: var(--text); border-color: #34506c; }
.btn-danger { background: rgba(242,105,120,.14); border-color: rgba(242,105,120,.32); color: #ffadb6; }
.btn-lg { min-height: 44px; padding: 10px 19px; font-size: 14px; }
#inbox-count { background: var(--accent); color: #052119; margin-left: 3px; }
.search-box input, .note-title-input, .modal-input, .import-textarea {
  background: rgba(3,10,19,.46); border-color: var(--border); border-radius: 9px;
}
.search-box input:focus, .note-title-input:focus, .modal-input:focus, .import-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.note-list li { border: 1px solid transparent; padding: 11px 12px; }
.note-list li:hover { background: rgba(255,255,255,.035); border-color: var(--border); }
.note-list li.active { background: var(--accent-soft); border-color: rgba(53,196,154,.24); border-left: 3px solid var(--accent); }
.editor-toolbar, .status-bar { background: rgba(13,26,43,.9); backdrop-filter: blur(16px); }
.note-editor { background: transparent; padding: 28px clamp(20px, 4vw, 64px); }
.note-preview { padding: 28px clamp(20px, 4vw, 64px); max-width: 980px; margin: 0 auto; width: 100%; }
.modal { background: #0e1d30; border-color: #294159; box-shadow: var(--shadow); }
.modal-header { position: sticky; top: 0; z-index: 2; background: #0e1d30; }
.modal-header h3 { color: var(--text); }
.inbox-card { background: rgba(255,255,255,.025); border-color: var(--border); }
.inbox-card:hover { border-color: #36536e; }

/* 欢迎与新手引导 */
.welcome-screen {
  align-items: stretch; justify-content: flex-start; overflow-y: auto;
  color: var(--text-secondary); text-align: left; padding: clamp(28px, 6vh, 70px) clamp(22px, 6vw, 88px);
}
.welcome-content { width: min(960px, 100%); margin: auto; }
.eyebrow {
  display: inline-flex; padding: 6px 10px; border: 1px solid rgba(53,196,154,.28);
  border-radius: 999px; background: var(--accent-soft); color: var(--primary-light);
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
}
.welcome-screen h2 {
  max-width: 760px; margin: 18px 0 12px; color: var(--text);
  font-size: clamp(30px, 4.3vw, 54px); line-height: 1.13; letter-spacing: -.035em;
}
.welcome-lead { max-width: 700px; color: var(--text-muted); font-size: clamp(15px, 1.6vw, 18px); line-height: 1.75; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 25px 0 34px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.guide-card {
  display: flex; gap: 12px; min-height: 132px; padding: 18px;
  background: linear-gradient(145deg, rgba(22,46,70,.82), rgba(12,27,45,.82));
  border: 1px solid var(--border); border-radius: 14px;
}
.guide-number {
  width: 28px; height: 28px; display:grid; place-items:center; flex: 0 0 auto;
  border-radius: 9px; background: var(--accent-soft); color: var(--primary-light); font-weight: 800;
}
.guide-card strong, .example-card strong { color: var(--text); font-size: 15px; }
.guide-card p, .example-card p { margin-top: 7px; color: var(--text-muted); font-size: 13px; line-height: 1.65; }
.example-card {
  display: flex; gap: 15px; align-items: flex-start; margin-top: 14px; padding: 18px;
  border: 1px solid rgba(87,145,206,.25); border-radius: 14px;
  background: linear-gradient(110deg, rgba(30,82,118,.18), rgba(53,196,154,.07));
}
.example-badge {
  flex: 0 0 auto; padding: 5px 9px; border-radius: 7px;
  background: rgba(91,157,220,.14); color: #9cccf8; font-size: 11px; font-weight: 700;
}

/* 平板 */
@media (max-width: 1024px) {
  :root { --sidebar-width: 280px; }
  .editor-toolbar { align-items: stretch; flex-wrap: wrap; padding: 10px 14px; }
  .note-title-input { min-width: 100%; }
  .toolbar-actions { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .toolbar-actions .btn { flex: 1 0 auto; }
  .guide-grid { grid-template-columns: 1fr 1fr; }
  .guide-card:last-child { grid-column: 1 / -1; min-height: auto; }
}

/* 手机 */
@media (max-width: 768px) {
  html, body, #app { width: 100%; max-width: 100%; overflow-x: hidden; }
  body, #app, .sidebar { height: 100dvh; }
  .hamburger-btn {
    display: grid; place-items: center; position: fixed; top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left)); z-index: 110; width: 44px; height: 44px;
    border: 1px solid var(--border); border-radius: 12px; background: rgba(13,26,43,.92);
    color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,.22); backdrop-filter: blur(12px);
  }
  .sidebar {
    width: min(88vw, 330px); min-width: 0; padding-top: env(safe-area-inset-top);
    box-shadow: 24px 0 70px rgba(0,0,0,.48);
  }
  .main-content {
    width: 100vw; max-width: 100vw; min-width: 0;
    padding-top: calc(56px + env(safe-area-inset-top));
  }
  .welcome-screen { padding: 24px 18px calc(28px + env(safe-area-inset-bottom)); }
  .welcome-content { margin: 0 auto; }
  .welcome-screen h2 { font-size: clamp(29px, 9vw, 40px); }
  .welcome-actions { display: grid; grid-template-columns: 1fr; }
  .welcome-actions .btn { width: 100%; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-card:last-child { grid-column: auto; }
  .guide-card { min-height: auto; }
  .example-card { flex-direction: column; }
  .editor-toolbar, .editor-area, .split-view, .note-knowledge-strip {
    width: 100%; max-width: 100%; min-width: 0;
  }
  .editor-toolbar { position: relative; }
  .note-title-input { width: 100%; min-width: 0; flex-basis: 100%; }
  .toolbar-actions { width: 100%; min-width: 0; }
  .note-editor, .note-preview { padding: 18px 16px calc(32px + env(safe-area-inset-bottom)); }
  .status-bar { padding: 7px 12px calc(7px + env(safe-area-inset-bottom)); gap: 8px; }
  .status-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .modal-overlay { align-items: flex-end; }
  .modal, .modal-wide {
    width: 100%; max-width: none; max-height: min(92dvh, 860px); border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-footer { position: sticky; bottom: 0; background: #0e1d30; }
  .inbox-modal { height: 94dvh; max-height: none; }
  .inbox-list { max-height: none; }
  .inbox-fields { grid-template-columns: 1fr; }
}

/* 小屏手机 */
@media (max-width: 480px) {
  .sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .clip-actions { grid-template-columns: 1fr 1fr !important; }
  .clip-actions .btn { min-height: 42px; font-size: 12px; }
  .toolbar-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); overflow: visible; }
  .toolbar-actions .btn { width: 100%; min-width: 0; }
  .welcome-screen h2 { letter-spacing: -.025em; }
  .modal-body, .modal-header, .modal-footer { padding-left: 16px; padding-right: 16px; }
}

/* V1.4 手机资料收录 */
.inbox-upload {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed #36536e;
  border-radius: 12px;
  background: rgba(53,196,154,.045);
}
.inbox-upload strong { color: var(--text); font-size: 14px; }
.inbox-upload p { margin-top: 4px; color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.inbox-file-button { display: inline-flex; justify-content: center; align-items: center; width: fit-content; }
.inbox-file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.inbox-file-list, .inbox-attachments { display: flex; flex-wrap: wrap; gap: 6px; }
.inbox-file-list span, .inbox-attachments span {
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--primary-light);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .inbox-file-button { width: 100%; min-height: 46px; }
}

/* ===== V1.7.2 AI知识中枢可见化 ===== */
.ai-hub-card {
  width: 100%; margin-top: 14px; padding: 11px; display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 9px;
  border: 1px solid rgba(53,196,154,.25); border-radius: 12px;
  background: linear-gradient(135deg, rgba(53,196,154,.12), rgba(50,120,190,.08));
  color: var(--text); text-align: left; cursor: pointer;
}
.ai-hub-card:hover { border-color: rgba(83,216,177,.55); background: rgba(53,196,154,.14); }
.ai-hub-icon {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  background: linear-gradient(145deg, #75e5c3, #2bb58b); color: #052119;
  font-size: 12px; font-weight: 900; box-shadow: 0 6px 18px rgba(53,196,154,.2);
}
.ai-hub-card strong { display: block; font-size: 13px; }
.ai-hub-card small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-hub-card b {
  padding: 4px 7px; border-radius: 999px; background: rgba(53,196,154,.15);
  color: var(--primary-light); font-size: 10px; white-space: nowrap;
}
.ai-hub-card b.offline { color: #ffc1c8; background: rgba(242,105,120,.13); }

.category-section { padding: 0 16px 10px; }
.sidebar-section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; color: var(--text-muted); font-size: 11px; }
.sidebar-section-title button { border: 0; background: transparent; color: var(--primary-light); cursor: pointer; font-size: 11px; }
.category-cloud { display: grid; gap: 5px; max-height: 220px; overflow-y: auto; padding-right: 2px; }
.category-cloud button {
  width: 100%; padding: 7px 9px; display: flex; justify-content: space-between; gap: 8px;
  border: 1px solid transparent; border-radius: 8px; background: rgba(255,255,255,.025);
  color: var(--text-secondary); cursor: pointer; text-align: left;
}
.category-cloud button:hover, .category-cloud button.active { border-color: rgba(53,196,154,.26); background: var(--accent-soft); color: var(--text); }
.category-cloud button.empty { opacity: .55; }
.category-cloud button.empty:hover, .category-cloud button.empty.active { opacity: 1; }
.category-cloud button b { color: var(--text-muted); font-size: 10px; }
.category-cloud small { color: var(--text-muted); font-size: 11px; }
.sidebar-section-title small { margin-left: 4px; color: var(--primary-light); font-size: 10px; font-weight: 700; }

.btn-ai {
  border: 1px solid rgba(77,168,255,.3);
  background: linear-gradient(135deg, rgba(67,137,255,.2), rgba(53,196,154,.16));
  color: #b9ddff;
}
.btn-ai:hover { border-color: rgba(100,183,255,.58); background: rgba(67,137,255,.24); color: #fff; }
.btn-ai:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.note-knowledge-strip {
  grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px;
  border-bottom: 1px solid var(--border); background: rgba(7,17,31,.7);
}
.note-knowledge-strip>div { min-width: 0; padding: 9px 14px; border-right: 1px solid var(--border); }
.note-knowledge-strip span { display: block; margin-bottom: 3px; color: var(--text-muted); font-size: 10px; }
.note-knowledge-strip strong { display: block; color: var(--text-secondary); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ai-overview {
  margin: 0 0 16px; padding: 18px; border: 1px solid rgba(83,161,224,.28);
  border-radius: 16px; background:
    radial-gradient(circle at 90% 0, rgba(56,135,224,.16), transparent 38%),
    linear-gradient(135deg, rgba(16,42,68,.92), rgba(10,28,47,.92));
}
.ai-overview-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.ai-overview-head span { display: block; color: #9cccf8; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.ai-overview-head strong { display: block; margin-top: 4px; color: var(--text); font-size: 17px; }
.ai-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.ai-metrics article { padding: 12px; border: 1px solid rgba(255,255,255,.06); border-radius: 11px; background: rgba(2,11,21,.34); }
.ai-metrics span { display: block; color: var(--text-muted); font-size: 10px; }
.ai-metrics strong { display: block; margin-top: 5px; color: var(--primary-light); font-size: 20px; }
.ai-metrics strong.metric-offline { color: #ffadb6; font-size: 13px; }

@media (max-width: 1024px) {
  .ai-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 768px) {
  .note-knowledge-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .note-knowledge-strip>div:nth-child(2) { border-right: 0; }
  .ai-overview { padding: 14px; }
  .ai-overview-head { align-items: stretch; flex-direction: column; }
  .ai-overview-head .btn { width: 100%; }
}
@media (max-width: 480px) {
  .ai-metrics { grid-template-columns: 1fr 1fr; }
  .ai-metrics article { padding: 10px; }
  .note-knowledge-strip>div { padding: 8px 10px; }
}
