* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; } /* #modal/#view-auth 的 display:flex 會蓋過 hidden 預設樣式 */
body {
  background: #060a14; color: #dbe4f5;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  min-height: 100vh;
}
button { cursor: pointer; font: inherit; }
input, textarea, select {
  font: inherit; color: #dbe4f5; background: #0a1122;
  border: 1px solid #1c2942; border-radius: 8px; padding: 8px 10px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 1px solid #38bdf8; }
.dim { color: #6b7a99; font-size: 13px; }
.err { color: #f87171; min-height: 1.2em; margin-top: 8px; font-size: 14px; }
.page { max-width: 860px; margin: 0 auto; padding: 20px; }

/* 色系:客戶端藍 / 價值主張紫 / 金流綠 / 供給端淡紫 */
.blue   { --c: #38bdf8; }
.purple { --c: #a78bfa; }
.green  { --c: #34d399; }
.lav    { --c: #c4b5fd; }

.bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid #131d33;
}
.bar h1 { font-size: 18px; }
.bar button {
  background: none; border: 1px solid #1c2942; color: #dbe4f5;
  border-radius: 8px; padding: 6px 12px;
}
#edit-name, #ov-name { font-weight: 700; }

/* auth */
#view-auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card {
  background: #0d1526; border: 1px solid #1c2942; border-radius: 16px;
  padding: 36px; width: 360px; text-align: center;
}
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: #6b7a99; font-size: 13px; margin-bottom: 24px; }
.auth-card input { margin-bottom: 12px; }
.auth-card button[type=submit] {
  width: 100%; background: #38bdf8; color: #04121f; border: 0;
  border-radius: 8px; padding: 10px; font-weight: 700;
}
.auth-switch { margin-top: 16px; font-size: 14px; color: #6b7a99; }
.auth-switch a { color: #38bdf8; }

/* list */
.add {
  background: none; border: 1px dashed #2b3c5e; color: #38bdf8;
  border-radius: 10px; padding: 10px 16px; margin-bottom: 16px;
}
#canvas-list { list-style: none; }
#canvas-list li {
  display: flex; align-items: center; gap: 12px;
  background: #0d1526; border: 1px solid #1c2942; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 10px; cursor: pointer;
}
#canvas-list li:hover { border-color: #38bdf8; }
#canvas-list .cname { flex: 1; font-weight: 700; }
#canvas-list button {
  background: none; border: 1px solid #1c2942; color: #6b7a99;
  border-radius: 6px; padding: 4px 10px; font-size: 13px;
}

/* edit:九點導航 */
#block-nav {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 14px 20px; border-bottom: 1px solid #131d33;
}
.nav-dot {
  background: #0d1526; border: 1px solid #1c2942; color: #8fa1c4;
  border-radius: 999px; padding: 6px 14px; font-size: 13px;
}
.nav-dot.active { border-color: var(--c); color: var(--c); font-weight: 700; }

.block-head { border-left: 4px solid var(--c); padding-left: 14px; margin-bottom: 8px; }
.block-head h2 { color: var(--c); font-size: 22px; }
.block-head .q { font-size: 16px; margin-top: 4px; }
.block-head .hint { color: #6b7a99; font-size: 13px; margin-top: 4px; }
.block-nav-arrows { display: flex; justify-content: space-between; margin: 14px 0 20px; }
.block-nav-arrows button {
  background: none; border: 1px solid #1c2942; color: #8fa1c4;
  border-radius: 8px; padding: 6px 14px;
}
.block-nav-arrows button:disabled { opacity: .3; cursor: default; }

label { display: block; font-size: 13px; color: #8fa1c4; margin-bottom: 10px; }
label input, label textarea { margin-top: 4px; }
.summary-label { margin-bottom: 18px; }

.cards { display: grid; gap: 14px; margin-bottom: 14px; }
.card {
  position: relative; background: #0d1526; border: 1px solid #1c2942;
  border-radius: 12px; padding: 16px;
}
.card .rm, .mrow .rm {
  background: none; border: 0; color: #6b7a99; font-size: 14px;
}
.card .rm { position: absolute; top: 10px; right: 10px; }

.mrow { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.mrow .m-item { flex: 1; }
.mrow .m-price { width: 120px; }
.mrow select { width: 110px; }
#money-total { color: #34d399; font-weight: 700; margin-top: 12px; }

.point-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }

/* overview 九宮格(重現簡報版面) */
#ov-grid {
  display: grid; gap: 14px; padding: 20px;
  grid-template-columns: repeat(5, 1fr);
  grid-template-areas:
    "b6 b7 b1 b3 b2"
    "b6 b8 b1 b4 b2"
    "b9 b9 b5 b5 b5";
}
.ov-cell {
  background: #0d1526; border: 1px solid #1c2942; border-radius: 12px;
  padding: 16px; cursor: pointer; min-height: 130px; overflow: hidden;
}
.ov-cell:hover { border-color: var(--c); }
.ov-cell h3 { color: var(--c); font-size: 15px; }
.ov-cell .q { font-size: 13px; margin: 4px 0 8px; }
.ov-cell ul { list-style: none; }
.ov-cell li {
  font-size: 12px; color: #8fa1c4; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px;
}
.ov-cell .more { color: #6b7a99; font-size: 12px; }
.ov-cell .empty { color: #f87171; font-size: 12px; }
@media (max-width: 900px) {
  #ov-grid { grid-template-columns: 1fr 1fr; grid-template-areas:
    "b1 b1" "b2 b3" "b4 b5" "b6 b7" "b8 b9"; }
}

/* modal */
#modal {
  position: fixed; inset: 0; background: rgba(3,6,12,.75);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
#modal-card {
  position: relative; background: #0d1526; border: 1px solid #2b3c5e;
  border-radius: 16px; padding: 28px; width: min(560px, 92vw);
  max-height: 80vh; overflow-y: auto;
}
#modal-close { position: absolute; top: 12px; right: 12px; background: none; border: 0; color: #6b7a99; }
#modal-body h2 { color: var(--c, #dbe4f5); margin-bottom: 4px; }
#modal-body .q { color: #8fa1c4; font-size: 14px; margin-bottom: 14px; }
#modal-body ul { list-style: none; }
#modal-body li { padding: 6px 0; border-bottom: 1px solid #131d33; font-size: 14px; }
#modal-body a { color: #38bdf8; word-break: break-all; }
#modal-edit { margin-top: 16px; }

/* toast */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1c2942; padding: 10px 20px; border-radius: 999px; font-size: 14px; z-index: 20;
}
