/* =====================================================
   Claude Note — Styles
   /lib/claude-note.css
   ===================================================== */

/* ── 整體容器 ── */
#cn-root {
  margin: 8px 0;
}

/* ── 每一個 Note（可折疊大區塊）── */
.cn-note {
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  margin-bottom: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.15s;
}
.cn-note:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

/* ── Note header（summary）── */
.cn-note-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: #f6f8fa;
  border-bottom: 1px solid transparent;
  transition: background 0.12s;
}
.cn-note-summary::-webkit-details-marker { display: none; }
.cn-note[open] > .cn-note-summary {
  background: #f0f3f6;
  border-bottom-color: #e1e4e8;
}
.cn-note-summary:hover {
  background: #edf1f5;
}

.cn-note-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}
.cn-note-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: #24292e;
  flex: 1;
}
.cn-note-summary-text {
  font-size: 0.79rem;
  color: #8b949e;
  margin-left: 4px;
  flex: 2;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cn-note-arrow {
  font-size: 0.68rem;
  color: #8b949e;
  transition: transform 0.18s;
  flex-shrink: 0;
}
.cn-note[open] .cn-note-arrow {
  transform: rotate(90deg);
}

/* ── Note 內容區 ── */
.cn-note-body {
  padding: 18px 20px 14px 20px;
}

/* ── 架構圖（可折疊）── */
.cn-arch-wrap {
  margin-bottom: 18px;
}
.cn-arch-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-size: 0.80rem;
  color: #586069;
  padding: 5px 0;
}
.cn-arch-toggle::-webkit-details-marker { display: none; }
.cn-arch-title { font-weight: 600; }
.cn-arch-arrow {
  font-size: 0.60rem;
  transition: transform 0.15s;
}
.cn-arch-details[open] .cn-arch-arrow { transform: rotate(90deg); }

.cn-arch {
  margin: 10px 0 4px 0;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  font-size: 0.80rem;
}
.cn-arch-layer {
  margin-bottom: 8px;
}
.cn-arch-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b949e;
  margin-bottom: 5px;
  font-weight: 600;
}
.cn-arch-label.arrow-row {
  color: #c8d3db;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.78rem;
  margin: 2px 0;
  text-align: center;
}
.cn-arch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.cn-arch-box {
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.79rem;
  font-weight: 500;
  border: 1.5px solid;
  text-align: center;
  min-width: 90px;
}
/* arch box 色系 */
.cn-arch-box.skill     { background:#f0f9ff; border-color:#38bdf8; color:#0369a1; }
.cn-arch-box.skill-dim { background:#f8fafc; border-color:#cbd5e1; color:#94a3b8; }
.cn-arch-box.vm        { background:#fff1f2; border-color:#fda4af; color:#9f1239; }
.cn-arch-box.user      { background:#f0fdf4; border-color:#86efac; color:#15803d; }
.cn-arch-box.guard     { background:#fefce8; border-color:#fde047; color:#854d0e; }
.cn-arch-box.modal     { background:#faf5ff; border-color:#d8b4fe; color:#6b21a8; }
.cn-arch-box.ok        { background:#f0fdf4; border-color:#4ade80; color:#166534; }
.cn-arch-box.server    { background:#fff7ed; border-color:#fb923c; color:#9a3412; }

/* ── Subtitle ── */
.cn-subtitle {
  font-size: 0.88rem;
  font-weight: 600;
  color: #24292e;
  border-left: 3px solid #e36209;
  padding-left: 8px;
  margin: 16px 0 8px 0;
}

/* ── Text ── */
.cn-text {
  font-size: 0.85rem;
  color: #444d56;
  line-height: 1.65;
  margin-bottom: 10px;
}
.cn-text code {
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.82em;
  color: #c7254e;
}

/* ── Warning ── */
.cn-warn {
  font-size: 0.82rem;
  background: #fff8ed;
  border: 1px solid #f6d860;
  border-left: 4px solid #e36209;
  border-radius: 0 5px 5px 0;
  padding: 8px 12px;
  color: #7d4e00;
  margin: 10px 0;
  line-height: 1.6;
}
.cn-warn code {
  background: #fef3c7;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.82em;
}

/* ── Code block ── */
.cn-code-wrap {
  position: relative;
  margin: 8px 0 12px 0;
}
.cn-code-lang {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 0.68rem;
  color: #8b949e;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  user-select: none;
}
.cn-code {
  display: block;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 0.80rem;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  color: #24292e;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

/* ── Table ── */
.cn-table-wrap {
  overflow-x: auto;
  margin: 8px 0 14px 0;
}
.cn-table-caption {
  font-size: 0.76rem;
  color: #8b949e;
  margin-bottom: 4px;
  font-weight: 500;
}
.cn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.cn-table thead tr {
  background: #f6f8fa;
  color: #24292e;
  font-weight: 600;
  text-align: left;
}
.cn-table th, .cn-table td {
  padding: 7px 12px;
  border-bottom: 1px solid #e1e4e8;
  vertical-align: top;
}
.cn-table tbody tr:last-child td { border-bottom: none; }
.cn-table tbody tr:hover { background: #f6f8fa; }
.cn-table code {
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.82em;
  color: #c7254e;
}

/* ── RWD ── */
@media (max-width: 640px) {
  .cn-note-body { padding: 14px 14px 10px 14px; }
  .cn-note-summary { padding: 11px 14px; }
  .cn-note-summary-text { display: none; }
  .cn-table { font-size: 0.76rem; }
  .cn-table th, .cn-table td { padding: 5px 8px; }
  .cn-arch-box { font-size: 0.73rem; padding: 4px 8px; min-width: 72px; }
}
