/* ==========================================================================
   拾光 MG 素材库 · Redesign Override v2.0
   --------------------------------------------------------------------------
   用法：在原样式表【之后】引入本文件即可（零 HTML / JS 改动）：
     <link rel="stylesheet" href="/_next/static/css/index.xxxx.css">  <!-- 原有 -->
     <link rel="stylesheet" href="/redesign-override.css">            <!-- 新增 -->
   或直接把本文件内容追加到原全局 CSS 末尾。
   原理：沿用原站全部 class 名与 CSS 变量名，仅重新定义视觉。
   参考效果：见同目录 preview-*.png 与 ../preview/redesign-*.png
   ========================================================================== */

/* ---------- 1. 设计令牌（沿用原变量名，替换取值） ---------- */
:root {
  --ink:   #16221d;
  --muted: #75817a;
  --paper: #f4f1e7;
  --panel: #fffdf7;
  --line:  #e3dfd0;
  --green: #1c4a3a;
  --lime:  #d7ec66;

  /* 新变量（仅供本文件内部使用） */
  --rd-deep:      #10312a;
  --rd-deep-2:    #0b2620;
  --rd-lime-soft: #eef7c8;
  --rd-sage:      #edf1e1;
  --rd-radius-lg: 22px;
  --rd-radius-md: 14px;
  --rd-radius-sm: 10px;
  --rd-shadow-lg: 0 24px 60px -24px rgba(16, 49, 42, .25);
  --rd-shadow-sm: 0 2px 10px -4px rgba(16, 49, 42, .12);
  --rd-serif: Georgia, "Songti SC", "Noto Serif SC", "SimSun", serif;
  --rd-mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--lime); color: var(--rd-deep); }

/* ---------- 2. 侧边栏 ---------- */
.sidebar {
  background: linear-gradient(175deg, var(--rd-deep) 0%, var(--rd-deep-2) 100%);
  padding: 30px 18px 22px;
}
.brand { padding-bottom: 26px; }
.brand-mark {
  border-radius: 13px;
  font-size: 21px;
  box-shadow: 0 8px 24px -8px rgba(215, 236, 102, .55);
}
.brand strong { letter-spacing: .1em; }
.brand small  { letter-spacing: .12em; color: #9db3a8; }

.workspace-nav { gap: 4px; margin-top: 24px; }
.workspace-nav a {
  border-radius: 11px;
  padding: 11px 12px;
  color: #a9bfb3;
  transition: background .16s ease, color .16s ease;
}
.workspace-nav a:hover { background: rgba(255, 255, 255, .06); color: #e8ecdc; }
.workspace-nav a.active {
  font-weight: 700;
  box-shadow: 0 8px 20px -8px rgba(215, 236, 102, .5);
}

.system-status {
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
}
.status-dot { animation: rd-pulse 2.4s infinite; }
@keyframes rd-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(215, 236, 102, .15); }
  50%      { box-shadow: 0 0 0 7px rgba(215, 236, 102, .07); }
}

/* ---------- 3. 主区骨架与排版 ---------- */
.workspace { padding: 40px 46px 64px; }

.eyebrow {
  font: 700 10px/1.2 var(--rd-mono);
  letter-spacing: .24em;
}
h1 {
  font-family: var(--rd-serif);
  font-weight: 500;
  letter-spacing: -.02em;
}
h2 { font-family: var(--rd-serif); font-weight: 600; font-size: 20px; }

.avatar {
  background: var(--rd-deep);
  color: var(--lime);
  border: 2px solid var(--panel);
  box-shadow: var(--rd-shadow-sm);
  font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease;
}
.avatar:hover { background: var(--rd-deep); transform: translateY(-1px); box-shadow: var(--rd-shadow-lg); }

/* ---------- 4. 卡片 ---------- */
.capture-card,
.material-search-card,
article,
.task-card,
.script-import-card {
  border-radius: var(--rd-radius-lg);
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--rd-shadow-sm);
}
.capture-card { box-shadow: var(--rd-shadow-sm); }

.capture-heading {
  background: linear-gradient(0deg, var(--panel), var(--rd-sage));
  border-bottom-color: var(--line);
  padding: 22px 26px;
}
.step {
  width: 32px; height: 32px;
  color: var(--lime);
  font-size: 11px;
  border-radius: 50%;
}
.capture-heading p { font-size: 12.5px; line-height: 1.7; }

/* ---------- 5. 表单 ---------- */
form { padding: 24px 26px 26px; gap: 18px; }
label { font-size: 12px; color: #3c4a43; letter-spacing: .02em; }

input, textarea, select {
  border-radius: 11px;
  background: #fbf9f3;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input { height: 48px; }
input:focus, textarea:focus, select:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(28, 74, 58, .1);
}

.upload-box {
  border: 1.5px dashed #b6bcae;
  border-radius: 12px;
  background: #f9f7f0;
  transition: border-color .18s ease, background .18s ease;
}
.upload-box:hover { border-color: var(--green); background: var(--rd-sage); }

.chips button {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #3c4a43;
  transition: all .16s ease;
}
.chips button:hover { border-color: #b3c272; background: var(--rd-lime-soft); }
.chips button.selected { box-shadow: 0 6px 14px -6px rgba(16, 49, 42, .4); }

/* ---------- 6. 按钮 ---------- */
.primary {
  min-height: 50px;
  border-radius: 12px;
  padding: 0 26px;
  font-size: 14px;
  box-shadow: 0 10px 24px -10px rgba(16, 49, 42, .45);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.primary:hover:not(:disabled) { background: var(--rd-deep); transform: translateY(-1px); }
.primary span { transition: transform .18s ease; }
.primary:hover:not(:disabled) span { transform: translateX(3px); }

.analyze-button {
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 12px;
  transition: all .16s ease;
}
.analyze-button:hover:not(:disabled) { background: var(--green); border-color: var(--green); color: #fff; }
.analyze-button.precise:hover:not(:disabled)  { background: #75551f; border-color: #75551f; }
.analyze-button.material:hover:not(:disabled) { background: #365a31; border-color: #365a31; }

.text-button { border-radius: 9px; padding: 8px 10px; }
.text-button:hover { background: var(--rd-sage); }

/* ---------- 7. 提示与帮助 ---------- */
.prompt-help span {
  background: var(--rd-sage);
  padding: 7px 12px;
  border-radius: 999px;
}
.source-notice {
  background: var(--rd-sage);
  border-color: #d7dfc0;
  border-radius: var(--rd-radius-md);
}
.feedback { border-radius: 9px; }

/* ---------- 8. 检索任务卡片（素材任务页） ---------- */
.search-job {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--rd-radius-md);
  padding: 20px 22px;
  box-shadow: var(--rd-shadow-sm);
}
.search-job-heading h3 { font-size: 15px; line-height: 1.55; }
.search-job-heading > small { font-family: var(--rd-mono); font-size: 10px; }

.job-status {
  padding: 5px 11px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.job-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.job-warning, .analysis-error { font-size: 12px; line-height: 1.7; }

/* 历史切换 → 分段控件 */
.history-switch {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}
.history-switch button {
  border: 0;
  min-height: 40px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}
.history-switch button[aria-pressed="true"] {
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(16, 49, 42, .4);
}

.module-shortcuts button {
  border-radius: 11px;
  padding: 10px 16px;
  transition: all .16s ease;
}
.module-shortcuts button:hover { border-color: var(--green); background: var(--rd-sage); }

/* ---------- 9. 候选素材网格 ---------- */
.candidate-card {
  border-radius: 12px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.candidate-card:hover { transform: translateY(-2px); box-shadow: var(--rd-shadow-lg); }
.candidate-card.selected {
  border-color: #8aaa58;
  box-shadow: 0 0 0 3px rgba(215, 236, 102, .4);
}

/* ---------- 10. 灵感记录卡片 ---------- */
article { border-radius: var(--rd-radius-md); }
.record-thumb span { border-radius: 7px; }
.record-body h3 { font-size: 15px; }
.keyword-row span { font-size: 10px; padding: 5px 9px; }
.analysis-details { border-radius: 10px; }
.material-search { background: var(--rd-sage); border-radius: 12px; }
.material-search-links a {
  border-radius: 10px;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.material-search-links a:hover { background: var(--rd-lime-soft); border-color: #b3c272; }

/* ---------- 11. 下载任务 ---------- */
.download-row strong { font-size: 13px; }

/* ---------- 12. 空状态 / 分页 ---------- */
.empty-state {
  border: 1.5px dashed #c9cdbc;
  border-radius: var(--rd-radius-lg);
  padding: 60px 32px;
  background: rgba(255, 253, 247, .6);
}
.empty-state strong { font-family: var(--rd-serif); font-size: 20px; font-weight: 600; }

.pagination button {
  border-radius: 10px;
  min-height: 42px;
  padding: 0 18px;
  transition: all .16s ease;
}
.pagination button:hover:not(:disabled) { border-color: var(--green); background: var(--rd-sage); }
.pagination span { font-family: var(--rd-mono); letter-spacing: .06em; }

/* ---------- 13. 剧本导入卡 ---------- */
.script-import-card {
  background: linear-gradient(135deg, var(--rd-sage), var(--panel));
  border-color: #d7dfc0;
}
.script-import-scenes label { border-radius: 12px; transition: all .16s ease; }
.script-import-scenes label.selected { background: var(--rd-lime-soft); border-color: #8aaa58; }

/* ---------- 14. 登录页：CSS 实现分屏（零改动近似版） ---------- */
.login-shell {
  background:
    radial-gradient(1100px 600px at 20% 10%, rgba(215, 236, 102, .14), transparent 60%),
    linear-gradient(90deg, var(--rd-deep) 0%, var(--rd-deep-2) 52%, var(--paper) 52%, var(--paper) 100%);
  justify-items: end;
  padding-right: max(6vw, 40px);
}
.login-card {
  border-radius: var(--rd-radius-lg);
  padding: 38px;
  box-shadow: var(--rd-shadow-lg);
}
.login-card h1 { font-family: var(--rd-serif); font-weight: 500; }
.login-form .primary { min-height: 52px; }
.login-safety { font-size: 12px; }

/* ---------- 15. 细节 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfccb9; border-radius: 99px; border: 2px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }

a, button { transition-property: background, color, border-color, box-shadow, transform; transition-duration: .16s; }

/* ---------- 16. 移动端微调（继承原断点，仅对齐新视觉） ---------- */
@media (max-width: 820px) {
  .sidebar { background: linear-gradient(175deg, var(--rd-deep), var(--rd-deep-2)); }
  .workspace-nav { background: var(--rd-deep); }
  .workspace { padding: 28px 18px calc(100px + env(safe-area-inset-bottom)); }
  .login-shell {
    background:
      radial-gradient(700px 360px at 50% 0%, rgba(215, 236, 102, .14), transparent 60%),
      linear-gradient(180deg, var(--rd-deep) 0%, var(--rd-deep-2) 34%, var(--paper) 34%, var(--paper) 100%);
    justify-items: center;
    padding: 24px;
  }
  .login-card { padding: 26px; }
}

