/* components.css — 通用可复用组件：标题、标签、栅格、卡片、要点列表、信息框/脚本框/类比框、
   图片辅助、代码框与复制按钮、示例文件框、对比表、步骤、任务框、时间线、行内二维码、
   微信卡片、工具卡片与徽标。跨模板复用，按原 base.css 顺序排列以保持层叠一致。 */

  /* 普通内容页 · 四列卡片等内容居中撑开 */
  .grid-4 { align-items: stretch; }
  .grid-4 .card {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    min-height: clamp(150px, 20vmin, 260px);
    padding: clamp(20px, 2.8vmin, 36px);
  }
  .grid-4 .card [style*="font-size:2em"] { font-size: clamp(2em, 5vmin, 3.2em) !important; }
  .grid-2 .steps { justify-content: space-evenly; min-height: clamp(200px, 28vmin, 360px); }
  .grid-2 > .info-box,
  .grid-2 > .script-box {
    display: flex; flex-direction: column; justify-content: center;
    min-height: clamp(200px, 28vmin, 360px);
  }
  .compare-table { flex: 0 0 auto; }

  /* 通用组件 */
  .content-header { margin-bottom: clamp(10px, 1.5vh, 20px); flex-shrink: 0; }
  .tag {
    display: inline-block; background: rgba(140,21,21,0.08);
    color: var(--pku-red-dark); padding: 6px 18px; border-radius: 20px;
    font-size: clamp(0.82em, 1.4vh, 0.95em); font-weight: 600; margin-bottom: 10px; border: 1px solid rgba(140,21,21,0.18);
  }
  .time-badge {
    display: inline-flex; align-items: center; gap: 5px;
    background: linear-gradient(135deg, var(--deyu-gold), #fbbf24);
    color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 0.78em; font-weight: 700; margin-left: 8px;
  }
  h2 { font-size: clamp(1.9em, 3.8vw, 2.85em); font-weight: 700; line-height: 1.28; color: var(--pku-red-dark); }
  h3 { font-size: clamp(1.2em, 2.4vh, 1.55em); font-weight: 600; margin-bottom: 10px; }
  h4 { font-size: clamp(1.05em, 1.9vh, 1.3em); font-weight: 600; }
  .grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2vw, 28px); }
  .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 1.8vw, 22px); }
  .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 1.5vw, 20px); }
  .card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
    padding: clamp(18px, 2.2vh, 28px); box-shadow: var(--shadow);
  }
  .card-icon {
    width: 48px; height: 48px; background: linear-gradient(135deg, var(--pku-red), var(--pku-red-light));
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 1.4em; margin-bottom: 12px; color: white;
  }
  .feature-list { list-style: none; }
  .feature-list li {
    padding: clamp(10px, 1.4vh, 14px) 0 clamp(10px, 1.4vh, 14px) 30px; position: relative;
    font-size: clamp(1.05em, 1.7vh, 1.2em);
    border-bottom: 1px solid var(--border);
  }
  .feature-list li:last-child { border-bottom: none; }
  .feature-list li::before {
    content: "✓"; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; background: linear-gradient(135deg, var(--pku-red), var(--pku-red-light));
    border-radius: 50%; color: #fff; font-size: 0.7em; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
  }
  .info-box {
    background: linear-gradient(135deg, rgba(140,21,21,0.06), rgba(140,21,21,0.02));
    border-left: 4px solid var(--pku-red); padding: clamp(14px, 2vh, 22px) clamp(16px, 2vw, 24px); border-radius: 0 12px 12px 0; margin: clamp(10px, 1.5vh, 18px) 0;
  }
  .info-box h4 { color: var(--pku-red-dark); font-size: clamp(1.05em, 1.75vh, 1.24em); margin-bottom: 6px; }
  .info-box p, .info-box li { font-size: clamp(1.08em, 1.75vh, 1.24em); line-height: 1.65; }
  .script-box {
    background: linear-gradient(135deg, rgba(217,119,6,0.08), rgba(251,191,36,0.04));
    border-left: 4px solid var(--deyu-gold); padding: 14px 18px; border-radius: 0 12px 12px 0;
  }
  .script-box h4 { color: #b45309; font-size: 0.9em; margin-bottom: 6px; }
  .analogy-box {
    background: linear-gradient(135deg, rgba(140,21,21,0.05), rgba(140,21,21,0.02));
    border: 2px dashed rgba(140,21,21,0.35); border-radius: 18px; padding: 24px; text-align: center;
  }
  .analogy-box .emoji { font-size: 2.4em; margin-bottom: 10px; }
  .analogy-box .icon-photo {
    width: 100%; max-width: 320px; height: clamp(120px, 18vh, 180px);
    object-fit: cover; border-radius: 14px; margin: 0 auto 14px;
    display: block; box-shadow: 0 4px 14px rgba(15,23,42,0.1);
  }
  .card-icon--photo {
    background: transparent !important; padding: 0; overflow: hidden;
    width: 56px; height: 56px;
  }
  .card-icon--photo img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block;
  }
  .grid-icon-photo {
    width: clamp(52px, 7vh, 68px); height: clamp(52px, 7vh, 68px);
    object-fit: cover; border-radius: 12px; margin: 0 auto 8px;
    display: block; box-shadow: 0 2px 8px rgba(15,23,42,0.08);
  }
  .tool-logo .tool-logo-img--card {
    width: 56px; height: 56px; object-fit: contain; margin: 0 auto 10px; display: block;
  }
  .flow-tool-photo {
    width: 72px; height: 72px; object-fit: contain; margin: 0 auto 8px; display: block;
  }
  .flow-tool-photo--cover {
    object-fit: cover; border-radius: 14px; box-shadow: 0 2px 10px rgba(15,23,42,0.1);
  }
  .code-box { background: #0f172a; border-radius: 12px; padding: clamp(18px, 2.5vmin, 28px); overflow-x: auto; }
  .code-box-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 10px;
  }
  .code-box-head h4 { color: #f0a0a0; font-size: 0.85em; margin-bottom: 0; }
  .copy-prompt-btn {
    flex-shrink: 0; padding: 6px 14px; border-radius: 8px;
    border: 1px solid rgba(252, 211, 77, 0.35);
    background: rgba(255, 255, 255, 0.08); color: #fcd34d;
    font-size: 0.82em; font-weight: 600; cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }
  .copy-prompt-btn:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(252, 211, 77, 0.55); }
  .copy-prompt-btn.copied {
    color: #86efac; border-color: rgba(134, 239, 172, 0.45);
    background: rgba(134, 239, 172, 0.12);
  }

  /* 知识库示例文件下载 */
  .sample-file-box {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(0,110,255,0.08), rgba(56,189,248,0.04));
    border: 1px solid rgba(0,110,255,0.22); border-left: 4px solid #006eff;
    border-radius: 0 14px 14px 0;
    padding: clamp(14px, 2vh, 20px) clamp(16px, 2vw, 22px);
    margin: clamp(10px, 1.5vh, 16px) 0;
  }
  .sample-file-box .sample-file-meta { flex: 1; min-width: min(100%, 260px); }
  .sample-file-box h4 { color: #006eff; font-size: clamp(1.05em, 1.65vh, 1.2em); margin-bottom: 6px; }
  .sample-file-box p { font-size: clamp(0.98em, 1.5vh, 1.1em); color: var(--text-secondary); line-height: 1.65; margin: 0; }
  .sample-file-actions { display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
  .sample-download-btn, .sample-preview-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; border-radius: 10px;
    font-size: 0.88em; font-weight: 700; text-decoration: none; cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .sample-download-btn {
    background: linear-gradient(135deg, #006eff, #38bdf8); color: #fff; border: none;
  }
  .sample-preview-btn {
    background: #fff; color: #006eff; border: 1px solid rgba(0,110,255,0.35);
  }
  .sample-download-btn:hover, .sample-preview-btn:hover {
    transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,110,255,0.22);
  }

  /* 代码框内文本与对比表 */
  .code-box h4 { color: #f0a0a0; font-size: 0.85em; margin-bottom: 10px; }
  .code-box pre {
    font-family: 'Fira Code','Consolas',monospace; font-size: clamp(0.92em, 1.6vh, 1.08em);
    line-height: 1.65; color: #e2e8f0; white-space: pre-wrap;
  }
  .compare-table { width: 100%; border-collapse: collapse; font-size: clamp(1.05em, 2vh, 1.38em); background: var(--bg-card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); flex-shrink: 0; }
  .compare-table th { background: linear-gradient(135deg, var(--pku-red-dark), var(--pku-red)); color: white; padding: clamp(14px, 2.8vh, 32px) clamp(16px, 2vw, 28px); text-align: left; font-size: clamp(0.95em, 1.8vh, 1.08em); }
  .compare-table td { padding: clamp(16px, 3vh, 36px) clamp(16px, 2vw, 28px); border-bottom: 1px solid var(--border); line-height: 1.65; vertical-align: middle; }

  /* 提示词优劣标签 + 步骤 + 任务框 */
  .tag-bad, .tag-good, .tag-preview {
    padding: clamp(4px, 0.8vh, 8px) clamp(10px, 1.2vw, 16px); border-radius: 20px;
    font-size: clamp(0.88em, 1.6vh, 1.05em); font-weight: 600;
  }
  .tag-bad { background: rgba(239,68,68,0.1); color: var(--danger); }
  .tag-good { background: rgba(140,21,21,0.1); color: var(--pku-red-dark); }
  .tag-preview { background: rgba(140,21,21,0.08); color: var(--pku-red-light); }
  .steps { display: flex; flex-direction: column; gap: clamp(14px, 2vh, 24px); flex: 1; justify-content: space-evenly; min-height: 0; }
  .step {
    display: flex; align-items: flex-start; gap: clamp(14px, 1.8vw, 22px);
    background: var(--bg-card); padding: clamp(18px, 2.4vh, 32px) clamp(20px, 2.5vw, 36px);
    border-radius: 14px; border: 1px solid var(--border);
  }
  .step-num {
    width: clamp(44px, 5vh, 60px); height: clamp(44px, 5vh, 60px);
    background: linear-gradient(135deg, var(--pku-red), var(--pku-red-light));
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: clamp(1em, 1.8vh, 1.3em); color: white; flex-shrink: 0;
  }
  .step-content h4 { margin-bottom: 4px; font-size: clamp(1.15em, 1.95vh, 1.45em); }
  .step-content p { color: var(--text-secondary); font-size: clamp(1.02em, 1.7vh, 1.2em); line-height: 1.65; }
  .task-box {
    background: linear-gradient(135deg, rgba(140,21,21,0.08), rgba(140,21,21,0.02));
    border: 2px solid rgba(140,21,21,0.25); border-radius: 16px; padding: 20px;
  }
  .task-box h3 { color: var(--pku-red-dark); font-size: clamp(1.15em, 1.9vh, 1.3em); margin-bottom: 10px; }
  .task-box ul { list-style: none; }
  .task-box li { padding: clamp(8px, 1.2vh, 12px) 0 clamp(8px, 1.2vh, 12px) 22px; position: relative; font-size: clamp(1.08em, 1.75vh, 1.24em); line-height: 1.6; }
  .task-box li::before { content: "✓"; position: absolute; left: 0; color: var(--pku-red); font-weight: bold; }

  /* 时间线 + 文本高亮 + 行内二维码 */
  .timeline-bar { display: grid; grid-template-columns: 10fr 20fr 20fr 7fr 3fr; gap: 6px; margin: 16px 0; }
  .timeline-seg {
    border-radius: 10px; padding: 12px 8px; text-align: center; color: #fff;
    font-weight: 700; font-size: 0.82em; line-height: 1.45;
  }
  .timeline-seg span { display: block; font-size: 1.3em; margin-bottom: 2px; }
  .highlight { color: var(--pku-red-dark); font-weight: 600; }
  .highlight-violet { color: var(--pku-red); font-weight: 600; }
  .highlight-green { color: var(--pku-red-dark); font-weight: 600; }
  .highlight-orange { color: #ea580c; font-weight: 600; }
  .inline-qr {
    background: #fff; border: 1.5px dashed rgba(140,21,21,0.3); border-radius: 18px;
    padding: 20px; text-align: center;
  }
  .inline-qr .qr-box {
    width: 160px; height: 160px; margin: 0 auto; padding: 10px;
    border-radius: 14px; border: 1px solid rgba(140,21,21,0.14);
    display: flex; align-items: center; justify-content: center;
  }
  .inline-qr .qr-box > div, .inline-qr .qr-box canvas { width: 140px !important; height: 140px !important; }

  /* 致谢页公众号卡片 */
  .wechat-card {
    background: #fff; border-radius: 20px;
    padding: clamp(16px, 2vh, 22px) clamp(18px, 2vw, 24px);
    text-align: center; box-shadow: var(--shadow-lg);
    border: 1px solid rgba(140,21,21,0.14);
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
  }
  .wechat-card-head {
    font-size: 0.88em; font-weight: 700; color: var(--primary-dark);
    margin-bottom: 10px;
  }
  .wechat-card img {
    display: block; width: 100%; max-width: 100%;
    height: auto; max-height: min(46vh, 440px);
    object-fit: contain; border-radius: 10px;
  }
  .wechat-card p {
    font-size: 0.86em; margin-top: 10px; color: var(--text-secondary);
  }

  /* 工具卡片 + 品牌 Logo + 标签 + 徽标 */
  .tool-card {
    border-radius: 18px; padding: clamp(18px, 2.5vh, 30px); height: 100%;
    border: 1.5px solid var(--border); background: var(--bg-card); box-shadow: var(--shadow);
  }
  .tool-card-deepseek { border-top: 4px solid #4d6bfe; }
  .tool-card-yuanbao { border-top: 4px solid #07c160; }
  .tool-card-ima { border-top: 4px solid #006eff; }
  .tool-card-aiteach { border-top: 4px solid var(--pku-red); }
  .tool-card-workbuddy { border-top: 4px solid #6C4DFF; }
  .tool-logo { font-size: 2.4em; margin-bottom: 8px; }
  .tool-logo:empty { display: none; }
  .tool-logo-img { display: inline-block; object-fit: contain; vertical-align: middle; }
  .tool-logo-img--inline { height: 1.2em; width: auto; margin-right: 8px; }
  .tool-logo-img--hero { height: 20px; width: auto; margin-right: 8px; vertical-align: -4px; }
  .tool-logo-img--summary { height: 36px; width: auto; max-width: 132px; margin: 0 auto 10px; display: block; }
  .tool-logo-img--summary-square { width: 40px; height: 40px; margin: 0 auto 10px; display: block; }
  .card-icon.brand-logo {
    background: #fff !important;
    border: 1px solid rgba(0,0,0,0.08);
    width: auto; min-width: 48px; padding: 8px 12px;
  }
  .card-icon.brand-logo img { height: 28px; width: auto; max-width: 118px; object-fit: contain; display: block; }
  .card-icon.brand-logo-square { padding: 8px; }
  .card-icon.brand-logo-square img { width: 32px; height: 32px; max-width: none; }
  .tool-name { font-size: 1.15em; font-weight: 800; margin-bottom: 4px; }
  .tool-url {
    display: inline-block; margin: 8px 0 12px;
    color: #4d6bfe; font-weight: 600; font-size: 0.88em; text-decoration: none;
  }
  .tool-url-ima { color: #006eff; }
  .tool-url-aiteach { color: var(--primary-dark); }
  .tool-url-workbuddy { color: #583ED3; }
  .tool-url-yuanbao { color: #059669; }
  .tool-url:hover { text-decoration: underline; }
  .tool-tag {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 0.72em; font-weight: 700; margin-right: 6px; margin-bottom: 6px;
  }
  .tool-tag-deepseek { background: rgba(77,107,254,0.1); color: #4d6bfe; }
  .tool-tag-yuanbao { background: rgba(7,193,96,0.12); color: #059669; }
  .tool-tag-ima { background: rgba(0,110,255,0.1); color: #006eff; }
  .tool-tag-aiteach { background: rgba(140,21,21,0.1); color: var(--pku-red-dark); }
  .tool-tag-workbuddy { background: rgba(108,77,255,0.12); color: #583ED3; }
  .flow-arrow {
    text-align: center; font-size: 1.8em; color: var(--text-secondary); padding: 8px 0;
  }
  .demo-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 8px; font-size: 0.75em; font-weight: 700; margin-bottom: 10px;
  }
  .demo-badge-deepseek { background: rgba(77,107,254,0.1); color: #4d6bfe; }
  .demo-badge-yuanbao { background: rgba(7,193,96,0.12); color: #059669; }
  .demo-badge-ima { background: rgba(0,110,255,0.1); color: #006eff; }
  .demo-badge-aiteach { background: rgba(140,21,21,0.1); color: var(--pku-red-dark); }
  .demo-badge-workbuddy { background: rgba(108,77,255,0.12); color: #583ED3; }
  .demo-badge-both { background: rgba(139,92,246,0.12); color: var(--accent); }
