/* ============================================================
   Lab 定制样式:去计时 + 专业排版 + Project ID 卡 + 复制按钮
   ============================================================ */

/* ---------- 0. 隐藏无意义的倒计时 ---------- */
.codelab-time-container,
.time-remaining { display: none !important; }

/* ---------- 1. 全局字体与底色 ---------- */
:root {
  --brand: #1a73e8;
  --brand-dark: #1557b0;
  --ink: #202124;
  --ink-soft: #3c4043;
  --line: #e8eaed;
  --bg: #f6f8fc;
}
body, google-codelab {
  font-family: 'Google Sans Text', 'Google Sans', Roboto,
               'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif !important;
  color: var(--ink);
  background: var(--bg) !important;
}

/* ---------- 2. 顶栏 ---------- */
#codelab-title {
  background: #fff !important;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(60,64,67,.08);
}
#codelab-title .title {
  font-family: 'Google Sans', 'Noto Sans SC', sans-serif !important;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: .2px;
}

/* ---------- 3. 左侧步骤导航 ---------- */
#drawer { background: #fff !important; border-right: 1px solid var(--line); }
#drawer .steps ol { counter-reset: none; padding: 12px 10px; }
#drawer li > a {
  border-radius: 10px;
  margin: 3px 6px;
  padding: 10px 12px 10px 8px;
  transition: background .15s, color .15s;
  color: var(--ink-soft) !important;
  line-height: 1.4;
}
#drawer li > a:hover { background: #f1f3f4; }
#drawer li[selected] > a {
  background: #e8f0fe !important;
  color: var(--brand-dark) !important;
  font-weight: 600;
}
/* 步骤序号圆点 */
#drawer li > a .step::before {
  background: #e0e0e0;
  color: #5f6368;
  font-weight: 600;
  box-shadow: none;
}
#drawer li[selected] > a .step::before,
#drawer li[completed] > a .step::before {
  background: var(--brand) !important;
  color: #fff !important;
}

/* ---------- 4. 正文卡片与排版 ---------- */
google-codelab-step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(60,64,67,.10);
  padding: 48px 56px 56px !important;
  margin: 28px auto;
  max-width: 820px;
}
google-codelab-step .instructions { max-width: none !important; }
google-codelab-step p,
google-codelab-step li {
  font-size: 16.5px;
  line-height: 2.0;
  color: var(--ink-soft);
  letter-spacing: .1px;
}
google-codelab-step p { margin: 0 0 20px; }
google-codelab-step ul, google-codelab-step ol { padding-left: 26px; margin: 4px 0 22px; }
google-codelab-step li { margin: 10px 0; padding-left: 4px; }
google-codelab-step li p { margin: 0 0 8px; }
google-codelab-step strong { color: var(--ink); font-weight: 600; }

/* 步骤大标题 */
google-codelab-step h2.step-title,
google-codelab-step .step-title {
  font-family: 'Google Sans', 'Noto Sans SC', sans-serif !important;
  font-size: 27px !important;
  font-weight: 500;
  color: var(--ink);
  padding-bottom: 16px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--line);
  line-height: 1.4;
}
google-codelab-step h3,
google-codelab-step h2[is-upgraded] {
  font-family: 'Google Sans', 'Noto Sans SC', sans-serif !important;
  font-size: 20px !important; font-weight: 500; color: var(--ink);
  margin-top: 40px !important; margin-bottom: 16px !important; line-height: 1.5;
  padding-left: 12px; border-left: 4px solid var(--brand);
}
/* 紧跟标题的首个段落/列表不要再顶太多空 */
google-codelab-step h2[is-upgraded] + p,
google-codelab-step h3 + p { margin-top: 0; }

/* 行内 code */
google-codelab-step p code,
google-codelab-step li code,
google-codelab-step td code {
  background: #f1f3f4;
  color: #b31412;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: 'Roboto Mono', ui-monospace, monospace;
  font-size: 13.5px;
}

/* 表格:概念对照表等,给足内边距与分隔线 */
google-codelab-step table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0 26px;
  font-size: 16px;
  box-shadow: 0 1px 3px rgba(60,64,67,.08);
  border-radius: 10px;
  overflow: hidden;
}
google-codelab-step th {
  background: #f1f3f4;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  padding: 14px 18px;
  border-bottom: 2px solid var(--line);
}
google-codelab-step td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  line-height: 1.8;
  vertical-align: top;
}
google-codelab-step tr:last-child td { border-bottom: none; }
google-codelab-step tbody tr:nth-child(even) { background: #fafbfc; }

/* ---------- 5. 代码块 ---------- */
google-codelab-step pre {
  background: #1e2233 !important;
  border: none;
  border-radius: 12px;
  padding: 18px 20px !important;
  margin: 18px 0;
  box-shadow: 0 2px 8px rgba(30,34,51,.20);
  overflow-x: auto;
}
google-codelab-step pre code {
  color: #e6e9f0 !important;
  background: transparent !important;
  font-family: 'Roboto Mono', ui-monospace, monospace;
  font-size: 13.5px;
  line-height: 1.7;
  padding: 0 !important;
}
/* prettify 语法高亮配色(暗底) */
google-codelab-step pre .kwd { color: #c792ea; }
google-codelab-step pre .str { color: #a5e075; }
google-codelab-step pre .com { color: #7d8799; font-style: italic; }
google-codelab-step pre .typ { color: #82aaff; }
google-codelab-step pre .lit { color: #f78c6c; }
google-codelab-step pre .pln { color: #e6e9f0; }
google-codelab-step pre .pun { color: #c3c8d4; }

/* 示例输出块(```text):区别于可复制的命令块,标为「输出」且不加复制按钮 */
google-codelab-step pre.sample-output {
  background: #2b2f36 !important;
  border-left: 4px solid #5f6368;
  box-shadow: none;
  padding-top: 34px !important;
}
google-codelab-step pre.sample-output::before {
  content: "示例输出 · 无需复制";
  position: absolute; top: 9px; left: 18px;
  font-size: 11px; letter-spacing: .3px; color: #9aa0a6;
  font-family: 'Google Sans', 'Noto Sans SC', sans-serif;
}

/* ---------- 6. Callout 提示框 ---------- */
google-codelab-step aside {
  border-radius: 10px;
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 15.5px;
  line-height: 1.9;
  border: none;
}
google-codelab-step aside p { margin: 0 0 8px; }
google-codelab-step aside p:last-child { margin: 0; }
google-codelab-step aside.special {
  background: #e6f4ea;
  border-left: 4px solid #34a853;
  color: #1e4620;
}
google-codelab-step aside.warning {
  background: #fef7e0;
  border-left: 4px solid #f9ab00;
  color: #5c3c00;
}
google-codelab-step aside code { background: rgba(0,0,0,.06); color: inherit; }

/* ---------- 7. 图片 ---------- */
google-codelab-step .image-container,
google-codelab-step img {
  text-align: center;
}
google-codelab-step img {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(60,64,67,.15);
  margin: 22px auto;
}
/* 小图标(内嵌在文字里的 icon)不要加边框阴影 */
google-codelab-step p img[src*="icon"],
google-codelab-step li img { box-shadow: none; border: none; border-radius: 4px; vertical-align: middle; }

/* ---------- 8. 底部导航按钮 ---------- */
#done, #controls .fab, paper-fab, #controls a[is-upgraded] {
  background: var(--brand) !important;
}

/* ============================================================
   右上角中英文切换
   ============================================================ */
#lang-toggle {
  position: fixed; top: 14px; right: 20px; z-index: 10000;
  display: flex; gap: 2px; background: #f1f3f4; border-radius: 999px;
  padding: 3px; box-shadow: 0 1px 3px rgba(60,64,67,.2);
  font-family: 'Google Sans', 'Noto Sans SC', sans-serif;
}
#lang-toggle .lang-opt {
  padding: 5px 15px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: #5f6368; text-decoration: none; line-height: 1.2; transition: background .15s, color .15s;
}
#lang-toggle .lang-opt.active { background: var(--brand); color: #fff; }
#lang-toggle .lang-opt:not(.active):hover { background: #e0e3e7; color: var(--ink); }

/* ============================================================
   Project ID 悬浮设置卡
   ============================================================ */
#pid-widget {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 4px 16px rgba(60,64,67,.20);
  padding: 14px 18px; width: 290px;
  font-family: 'Google Sans', 'Noto Sans SC', sans-serif;
}
#pid-widget label {
  display: block; font-size: 12px; font-weight: 700; color: #5f6368;
  margin-bottom: 8px; letter-spacing: .4px;
}
#pid-widget input {
  width: 100%; box-sizing: border-box; border: 1.5px solid var(--line);
  border-radius: 8px; padding: 9px 11px; font-size: 13px;
  font-family: 'Roboto Mono', monospace; outline: none; transition: border-color .15s;
}
#pid-widget input { margin-bottom: 12px; }
#pid-widget input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
#pid-widget .pid-title { font-size: 13px; color: var(--ink); letter-spacing: .2px; }
#pid-widget .pid-body label:not(:first-child) { margin-top: 2px; }
#pid-widget .pid-status { font-size: 11.5px; margin-top: 8px; line-height: 1.5; }
#pid-widget .pid-status.ok { color: #137333; }
#pid-widget .pid-status.warn { color: #b06000; }
#pid-widget .pid-toggle {
  position: absolute; top: 10px; right: 12px; cursor: pointer;
  border: none; background: none; color: #5f6368; font-size: 16px; line-height: 1;
}
#pid-widget.collapsed { width: auto; padding: 12px 38px 12px 16px; cursor: pointer; }
#pid-widget.collapsed .pid-body { display: none; }
#pid-widget.collapsed label { margin: 0; }

/* 占位符高亮 */
.pid-missing { background: #fde293; color: #b06000; font-weight: 700; border-radius: 4px; padding: 0 4px; }
.pid-sub     { background: #a5e075; color: #1e4620; font-weight: 700; border-radius: 4px; padding: 0 4px; }

/* ============================================================
   代码块一键复制按钮
   ============================================================ */
google-codelab-step pre { position: relative; }
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  border: 1px solid rgba(255,255,255,.25); border-radius: 7px;
  background: rgba(255,255,255,.10); color: #d7dbe6;
  font-size: 12px; font-family: 'Google Sans', 'Noto Sans SC', sans-serif;
  padding: 5px 12px; cursor: pointer; opacity: 0; transition: all .15s;
  backdrop-filter: blur(2px);
}
google-codelab-step pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255,255,255,.22); color: #fff; }
.copy-btn.done { background: #34a853; border-color: #34a853; color: #fff; opacity: 1; }

@media (max-width: 900px) {
  google-codelab-step { padding: 28px 22px !important; border-radius: 0; }
  #pid-widget { top: auto; bottom: 14px; right: 14px; width: 250px; }
  .copy-btn { opacity: 1; }
}
