/* 光刻 AI 使用教程页样式。
   和首页同一套「石墨影棚」配色：深色底 + 暖金点缀，复用 main.css / theme.css 的变量和主题切换。
   这里只加教程页自己的东西（版式、目录、提示框、表格、灯箱），颜色都走下面几个变量，
   浅色模式只需在文件末尾改变量。 */

#gk-graphite.gk-tutorial {
  --tut-text:#e9e5dc;          /* 正文 */
  --tut-muted:#aaa69b;         /* 次要文字 */
  --tut-faint:#8d8a82;         /* 更淡的文字 */
  --tut-line:#ffffff16;        /* 分隔线 */
  --tut-line-strong:#ffffff2b;
  --tut-surface:#202122;       /* 浮起的面板 */
  --tut-surface-2:#262728;
  --tut-code-bg:#2a2b2c;
  --tut-code-text:#f3d9ae;
  --tut-link:#e5b16a;
  --tut-warn:#e3b341;          /* 注意 */
  --tut-cost:#e5b16a;          /* 要花钱 */
  --tut-tip:#9fb9c9;           /* 提示 */
}

/* ---- 页头 ---- */
#gk-graphite .gk-header a, #gk-graphite .gk-tut-switch a, #gk-graphite .gk-tut-pager a, #gk-graphite .gk-tut-toc a { text-decoration:none; }
#gk-graphite .gk-header .gk-brand { color:inherit; }
#gk-graphite .gk-tut-headnav { display:flex; align-items:center; gap:14px; min-width:0; }
#gk-graphite .gk-tut-headnav .gk-nav-link { display:inline-flex; align-items:center; gap:6px; }
#gk-graphite .gk-tut-headnav .gk-nav-link svg { width:14px; height:14px; }
#gk-graphite .gk-tut-headnav-sep { width:1px; height:16px; background:var(--tut-line-strong); }
#gk-graphite .gk-tut-headnav-title { display:inline-flex; align-items:center; gap:6px; color:var(--tut-muted); font-size:12px; letter-spacing:.04em; white-space:nowrap; }
#gk-graphite .gk-tut-headnav-title svg { width:14px; height:14px; color:var(--gk-gold); }

/* ---- 三页切换 ---- */
#gk-graphite .gk-tut-switch { display:flex; flex-wrap:wrap; gap:8px; padding:18px 0 0; }
#gk-graphite .gk-tut-switch-link { display:inline-flex; align-items:center; min-height:38px; padding:7px 16px; border:1px solid #ffffff27; border-radius:6px; color:#b1afa6; font-size:12px; transition:border-color .18s,color .18s,background .18s; }
#gk-graphite .gk-tut-switch-link:hover { color:var(--gk-gold); border-color:#e5b16a6b; }
#gk-graphite .gk-tut-switch-link[aria-current="page"] { color:#241c12; background:var(--gk-gold); border-color:var(--gk-gold); }

/* ---- 版式：左目录 + 右正文 ---- */
#gk-graphite .gk-tut-layout { display:grid; grid-template-columns:232px minmax(0,820px); justify-content:center; gap:56px; padding:34px 0 48px; }
#gk-graphite .gk-tut-side { min-width:0; }
#gk-graphite .gk-tut-toc { position:sticky; top:20px; max-height:calc(100vh - 40px); overflow:auto; padding:4px 0; scrollbar-width:thin; }
#gk-graphite .gk-tut-toc summary { display:flex; align-items:center; gap:8px; list-style:none; min-height:36px; padding:6px 0; color:var(--tut-muted); font-size:11px; letter-spacing:.14em; text-transform:uppercase; pointer-events:none; }
#gk-graphite .gk-tut-toc summary::-webkit-details-marker { display:none; }
#gk-graphite .gk-tut-toc summary svg { width:14px; height:14px; color:var(--gk-gold); }
#gk-graphite .gk-tut-toc-caret { display:none; margin-left:auto; transition:transform .15s; }
#gk-graphite .gk-tut-toc-list ol { list-style:none; margin:0; padding:0; }
#gk-graphite .gk-tut-toc-list > ol { border-left:1px solid var(--tut-line-strong); }
#gk-graphite .gk-tut-toc-list li { margin:0; }
#gk-graphite .gk-tut-toc-list a { display:block; padding:7px 0 7px 14px; margin-left:-1px; border-left:1px solid transparent; color:var(--tut-muted); font-size:12.5px; line-height:1.55; transition:color .15s,border-color .15s; }
#gk-graphite .gk-tut-toc-list ol ol a { padding-left:28px; font-size:12px; color:var(--tut-faint); }
#gk-graphite .gk-tut-toc-list a:hover { color:var(--tut-text); }
#gk-graphite .gk-tut-toc-list a[aria-current="true"] { color:var(--gk-gold); border-left-color:var(--gk-gold); }
#gk-graphite .gk-tut-toc-empty { color:var(--tut-faint); font-size:12px; padding:6px 0; }

/* ---- 正文 ---- */
#gk-graphite .gk-tut-main { min-width:0; }
#gk-graphite .gk-tut-article { color:var(--tut-text); font-size:15px; line-height:1.95; }
#gk-graphite .gk-tut-article > .gk-eyebrow { margin-bottom:10px; }
#gk-graphite .gk-tut-article h1 { font-size:clamp(28px,3.4cqw,38px); font-weight:650; line-height:1.3; letter-spacing:-.03em; margin:0 0 28px; padding-bottom:22px; border-bottom:1px solid var(--tut-line); color:#f4f1ea; }
#gk-graphite .gk-tut-article h2 { position:relative; font-size:clamp(21px,2.2cqw,25px); font-weight:600; letter-spacing:-.02em; line-height:1.45; margin:48px 0 16px; padding-top:22px; border-top:1px solid var(--tut-line); text-wrap:balance; }
#gk-graphite .gk-tut-article h3 { position:relative; font-size:17px; font-weight:600; line-height:1.5; margin:32px 0 10px; color:#f0ebe1; }
#gk-graphite .gk-tut-article h4 { font-size:15px; font-weight:600; margin:22px 0 8px; color:var(--tut-text); }
#gk-graphite .gk-tut-article :is(h1,h2,h3) { scroll-margin-top:24px; }
#gk-graphite .gk-tut-anchor { position:absolute; left:-20px; opacity:0; color:var(--gk-gold); font-weight:400; transition:opacity .15s; }
#gk-graphite .gk-tut-article h2 .gk-tut-anchor { top:22px; }
#gk-graphite .gk-tut-article :is(h2,h3):hover .gk-tut-anchor, #gk-graphite .gk-tut-anchor:focus-visible { opacity:1; }
#gk-graphite .gk-tut-article p { margin:0 0 16px; }
#gk-graphite .gk-tut-article strong { color:#f7efe0; font-weight:600; }
#gk-graphite .gk-tut-article a:not(.gk-tut-anchor):not(.gk-tut-zoom) { color:var(--tut-link); text-decoration:underline; text-decoration-color:#e5b16a55; text-underline-offset:3px; }
#gk-graphite .gk-tut-article a:not(.gk-tut-anchor):not(.gk-tut-zoom):hover { text-decoration-color:var(--tut-link); }
#gk-graphite .gk-tut-article code { padding:2px 6px; border-radius:5px; background:var(--tut-code-bg); color:var(--tut-code-text); font:13px/1.6 Consolas,"Cascadia Mono","Microsoft YaHei",monospace; }
#gk-graphite .gk-tut-article pre { margin:0 0 18px; padding:14px 16px; border:1px solid var(--tut-line); border-radius:9px; background:var(--tut-code-bg); overflow:auto; }
#gk-graphite .gk-tut-article pre code { padding:0; background:none; color:#e9e5dc; font-size:12.5px; line-height:1.7; }
#gk-graphite .gk-tut-article hr { border:0; border-top:1px dashed var(--tut-line-strong); margin:32px 0; }
#gk-graphite .gk-tut-article :is(ul,ol) { margin:0 0 16px; padding-left:1.6em; }
#gk-graphite .gk-tut-article li { margin:4px 0; }
#gk-graphite .gk-tut-article li > :is(ul,ol) { margin:6px 0 4px; }
#gk-graphite .gk-tut-article li > p { margin:4px 0; }
#gk-graphite .gk-tut-article ol { list-style:decimal; }
#gk-graphite .gk-tut-article ol > li::marker { color:var(--gk-gold); font-weight:600; }
#gk-graphite .gk-tut-article ul > li::marker { color:var(--gk-gold); }
#gk-graphite .gk-tut-article img { max-width:100%; height:auto; }
#gk-graphite .gk-tut-article p > img { display:inline-block; vertical-align:middle; max-height:1.6em; width:auto; }

/* 截图：撑满正文区，细边框 + 圆角，可点击放大 */
#gk-graphite .gk-tut-figure { margin:22px 0 26px; text-align:center; }
#gk-graphite .gk-tut-zoom { display:inline-block; max-width:100%; vertical-align:top; position:relative; border:1px solid var(--tut-line-strong); border-radius:10px; overflow:hidden; background:var(--tut-surface); transition:border-color .18s,box-shadow .18s; }
#gk-graphite .gk-tut-zoom:hover { border-color:#e5b16a80; box-shadow:0 10px 30px #0004; }
#gk-graphite .gk-tut-zoom::after { content:""; position:absolute; right:10px; bottom:10px; width:28px; height:28px; border-radius:50%; background:#000000a8 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23e5b16a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/><line x1='11' y1='8' x2='11' y2='14'/><line x1='8' y1='11' x2='14' y2='11'/></svg>") center/14px no-repeat; opacity:0; transition:opacity .18s; pointer-events:none; }
#gk-graphite .gk-tut-zoom:hover::after { opacity:1; }
#gk-graphite .gk-tut-figure img { display:block; max-width:100%; height:auto; }
#gk-graphite .gk-tut-figure figcaption { margin-top:9px; color:var(--tut-faint); font-size:12px; line-height:1.7; text-align:center; }

/* 提示框：注意（黄）/ 要花钱（金）/ 提示（灰蓝） */
#gk-graphite .gk-tut-callout { --co:var(--tut-tip); margin:18px 0 20px; padding:14px 18px 6px; border:1px solid color-mix(in srgb,var(--co) 35%,transparent); border-left:3px solid var(--co); border-radius:10px; background:color-mix(in srgb,var(--co) 7%,var(--tut-surface)); font-size:14px; line-height:1.85; }
#gk-graphite .gk-tut-callout-warn { --co:var(--tut-warn); }
#gk-graphite .gk-tut-callout-cost { --co:var(--tut-cost); }
#gk-graphite .gk-tut-callout-start { --co:var(--tut-link); padding-bottom:10px; }
#gk-graphite .gk-tut-article mark { padding:1px 4px; border-radius:4px; background:color-mix(in srgb,var(--tut-warn) 22%,transparent); color:var(--tut-text); }
#gk-graphite .gk-tut-callout-head { display:inline-flex; align-items:center; gap:7px; margin-bottom:6px; color:var(--co); font-size:12px; font-weight:600; letter-spacing:.06em; }
#gk-graphite .gk-tut-callout-cost .gk-tut-callout-head { padding:3px 9px 3px 7px; border:1px solid color-mix(in srgb,var(--co) 55%,transparent); border-radius:999px; background:color-mix(in srgb,var(--co) 14%,transparent); }
#gk-graphite .gk-tut-callout-head svg { width:15px; height:15px; }
#gk-graphite .gk-tut-callout-body p { margin:0 0 10px; }
#gk-graphite .gk-tut-callout-body :is(ul,ol) { margin:0 0 10px; }

/* 表格 */
#gk-graphite .gk-tut-table { margin:0 0 20px; overflow-x:auto; border:1px solid var(--tut-line); border-radius:9px; }
#gk-graphite .gk-tut-table table { width:100%; border-collapse:collapse; font-size:13.5px; line-height:1.7; }
#gk-graphite .gk-tut-table th, #gk-graphite .gk-tut-table td { padding:10px 14px; border-bottom:1px solid var(--tut-line); text-align:left; vertical-align:top; }
#gk-graphite .gk-tut-table th { background:var(--tut-surface); color:var(--gk-gold); font-weight:600; font-size:12px; letter-spacing:.04em; white-space:nowrap; }
#gk-graphite .gk-tut-table tbody tr:last-child td { border-bottom:0; }
#gk-graphite .gk-tut-table tbody tr:nth-child(even) td { background:#ffffff05; }

/* 上一篇 / 下一篇 */
#gk-graphite .gk-tut-pager { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:44px; padding-top:26px; border-top:1px solid var(--tut-line); }
#gk-graphite .gk-tut-pager-link { display:flex; align-items:center; gap:12px; min-height:64px; padding:12px 16px; border:1px solid var(--tut-line-strong); border-radius:10px; color:var(--tut-text); font-size:14px; transition:border-color .18s,background .18s; }
#gk-graphite .gk-tut-pager-link:hover { border-color:#e5b16a80; background:#ffffff05; }
#gk-graphite .gk-tut-pager-link small { display:block; color:var(--tut-faint); font-size:11px; letter-spacing:.08em; margin-bottom:2px; }
#gk-graphite .gk-tut-pager-link svg { width:16px; height:16px; color:var(--gk-gold); }
#gk-graphite .gk-tut-pager-next { justify-content:flex-end; text-align:right; }

/* 灯箱 */
#gk-graphite .gk-tut-lightbox { position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center; padding:24px; background:#0f0f0ee6; backdrop-filter:blur(4px); }
#gk-graphite .gk-tut-lightbox figure { margin:0; max-width:min(1400px,100%); max-height:100%; display:flex; flex-direction:column; align-items:center; gap:12px; }
#gk-graphite .gk-tut-lightbox img { display:block; max-width:100%; max-height:calc(100vh - 110px); border:1px solid #ffffff2b; border-radius:8px; box-shadow:0 30px 90px #000a; cursor:zoom-out; }
#gk-graphite .gk-tut-lightbox figcaption { color:#cdc6b8; font-size:13px; text-align:center; }
#gk-graphite .gk-tut-lightbox figcaption:empty { display:none; }
#gk-graphite .gk-tut-lightbox-close { position:fixed; top:16px; right:16px; display:flex; align-items:center; justify-content:center; width:44px; height:44px; padding:0; border:1px solid #ffffff33; border-radius:50%; background:#1d1e1f; color:#f4f1ea; }
#gk-graphite .gk-tut-lightbox-close:hover { border-color:var(--gk-gold); color:var(--gk-gold); }
#gk-graphite .gk-tut-lightbox-close svg { width:18px; height:18px; }
#gk-graphite.gk-tut-lightbox-open { overflow:hidden; }
body.gk-tut-noscroll { overflow:hidden; }

/* ---- 窄屏 ---- */
@container (max-width:980px) {
  #gk-graphite .gk-tut-layout { grid-template-columns:200px minmax(0,1fr); gap:36px; }
}
@container (max-width:820px) {
  #gk-graphite .gk-tut-layout { grid-template-columns:1fr; gap:22px; padding-top:22px; }
  #gk-graphite .gk-tut-side { order:0; }
  #gk-graphite .gk-tut-toc { position:static; max-height:none; overflow:visible; padding:0; border:1px solid var(--tut-line-strong); border-radius:10px; background:var(--tut-surface); }
  #gk-graphite .gk-tut-toc summary { pointer-events:auto; min-height:46px; padding:8px 14px; }
  #gk-graphite .gk-tut-toc-caret { display:block; color:var(--tut-muted); }
  #gk-graphite .gk-tut-toc[open] .gk-tut-toc-caret { transform:rotate(180deg); }
  #gk-graphite .gk-tut-toc-list { padding:0 14px 10px; }
  #gk-graphite .gk-tut-toc-list > ol { border-left:0; }
  #gk-graphite .gk-tut-toc-list a { padding-left:0; border-left:0; margin-left:0; }
  #gk-graphite .gk-tut-toc-list a[aria-current="true"] { border-left:0; }
  #gk-graphite .gk-tut-toc-list ol ol a { padding-left:16px; }
  #gk-graphite .gk-tut-anchor { display:none; }
  #gk-graphite .gk-tut-headnav-title { display:none; }
  #gk-graphite .gk-tut-headnav-sep { display:none; }
}
@container (max-width:580px) {
  #gk-graphite .gk-tut-switch { padding-top:14px; }
  #gk-graphite .gk-tut-switch-link { flex:1; justify-content:center; padding:7px 10px; }
  #gk-graphite .gk-tut-article { font-size:14.5px; line-height:1.9; }
  #gk-graphite .gk-tut-article h1 { margin-bottom:22px; padding-bottom:16px; }
  #gk-graphite .gk-tut-article h2 { margin-top:36px; padding-top:18px; }
  #gk-graphite .gk-tut-article :is(ul,ol) { padding-left:1.35em; }
  #gk-graphite .gk-tut-callout { padding:12px 14px 4px; }
  #gk-graphite .gk-tut-table th, #gk-graphite .gk-tut-table td { padding:8px 10px; }
  #gk-graphite .gk-tut-pager { grid-template-columns:1fr; gap:10px; }
  #gk-graphite .gk-tut-pager-next { justify-content:space-between; }
  #gk-graphite .gk-tut-lightbox { padding:12px; }
  #gk-graphite .gk-tut-lightbox-close { top:10px; right:10px; width:40px; height:40px; }
}

/* ---- 浅色模式：只改变量和几个写死的颜色 ---- */
:root[data-theme="light"] #gk-graphite.gk-tutorial {
  --tut-text:#2b2c2c;
  --tut-muted:#646159;
  --tut-faint:#7d796f;
  --tut-line:#36332c1f;
  --tut-line-strong:#36332c38;
  --tut-surface:#fffefa;
  --tut-surface-2:#f3f1ea;
  --tut-code-bg:#efeae0;
  --tut-code-text:#7a4f1a;
  --tut-link:#8d5f25;
  --tut-warn:#b8860b;
  --tut-cost:#8d5f25;
  --tut-tip:#4f7488;
}
:root[data-theme="light"] #gk-graphite .gk-tut-article :is(h1,h3), :root[data-theme="light"] #gk-graphite .gk-tut-article strong { color:#1f2021; }
:root[data-theme="light"] #gk-graphite .gk-tut-article pre code { color:#2b2c2c; }
:root[data-theme="light"] #gk-graphite .gk-tut-switch-link { border-color:#36332c38; color:var(--tut-text); }
:root[data-theme="light"] #gk-graphite .gk-tut-switch-link:hover { color:var(--gk-gold); border-color:#8d5f2570; }
:root[data-theme="light"] #gk-graphite .gk-tut-switch-link[aria-current="page"] { background:#e5b16a; border-color:#e5b16a; color:#241c12; }
:root[data-theme="light"] #gk-graphite .gk-tut-zoom:hover { box-shadow:0 10px 30px #3930231f; }
:root[data-theme="light"] #gk-graphite .gk-tut-table tbody tr:nth-child(even) td { background:#36332c06; }
:root[data-theme="light"] #gk-graphite .gk-tut-pager-link:hover { background:#8d5f2508; }
:root[data-theme="light"] #gk-graphite .gk-tut-lightbox { background:#1b1915e0; }
