:root {
  color-scheme: light;
  --bg: #fbf8ef;
  --surface: #ffffff;
  --surface-sunk: #f4efe1;
  --border: #e6dfc8;
  --border-strong: #d6cda8;
  --text: #2b2a22;
  --text-muted: #70695a;
  --accent: #d5a93a;
  --accent-soft: #f3d883;
  --accent-hover: #b88e21;
  --leaf: #6f9a6b;
  --leaf-soft: #d6e6d2;
  --leaf-hover: #557a52;
  --danger: #b04a3b;
  --warn: #a07321;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(60, 50, 20, 0.04);
  --shadow: 0 4px 14px rgba(60, 50, 20, 0.08);
  --sky: #6a92c0;
  --sky-soft: #d3e1f0;
  font-family: "Inter", "Noto Sans TC", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

a { color: var(--leaf-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

header .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
header .brand:hover { text-decoration: none; color: var(--leaf-hover); }
header .brand img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: block;
}

header nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
header nav a {
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
header nav a:hover {
  background: var(--surface-sunk);
  color: var(--text);
  text-decoration: none;
}

main { padding: 0; }

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
  color: var(--text);
}

section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

p { margin: 0.5rem 0; }
.hint { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.25rem; }

form {
  display: grid;
  gap: 0.75rem;
  max-width: 420px;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input:not([type]),
input[type="search"],
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
textarea {
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 6rem;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--leaf);
  margin-right: 0.4rem;
}

button, input[type="submit"] {
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  color: #1b2a1a;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
button:hover, input[type="submit"]:hover {
  background: var(--accent);
  border-color: var(--accent-hover);
}
button:active { transform: translateY(1px); }
button:disabled {
  background: var(--surface-sunk);
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

button.secondary {
  background: var(--leaf-soft);
  border-color: var(--leaf);
  color: #1b2a1a;
}
button.secondary:hover {
  background: var(--leaf);
  color: #fff;
  border-color: var(--leaf-hover);
}

button.danger {
  background: #f5e0db;
  border-color: var(--danger);
  color: #5b2018;
}
button.danger:hover {
  background: var(--danger);
  color: #fff;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: grid;
  gap: 0.5rem;
}
ul li {
  background: var(--surface-sunk);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
ul li a {
  font-weight: 500;
  color: var(--leaf-hover);
}

code {
  background: var(--surface-sunk);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.35rem;
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: #524a34;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
th {
  background: var(--surface-sunk);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0.5rem 0;
}
.warn {
  color: var(--warn);
  font-size: 0.9rem;
}

#invite-url {
  word-break: break-all;
  background: var(--leaf-soft);
  border: 1px solid var(--leaf);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.9rem;
  color: #2d3a2c;
}
#invite-url:empty { display: none; }

@media (max-width: 640px) {
  body { padding: 1.25rem 0.9rem 3rem; }
  header { padding: 0.6rem 0.85rem; border-radius: var(--radius); }
  section { padding: 1rem 1.1rem; border-radius: var(--radius); }
  h1 { font-size: 1.5rem; }
}

/* Landing page */
.landing-hero {
  text-align: center;
  padding: 2.5rem 1rem 0.5rem;
  margin-bottom: 2rem;
}
.landing-hero h1 {
  font-size: 2.4rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.landing-hero .sub {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}
.landing-hero .sub strong { color: var(--text); font-weight: 500; }

.landing-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1rem 0;
  margin-bottom: 2rem;
}
.landing-cta .btn {
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.landing-cta .btn.primary { background: var(--accent-soft); border-color: var(--accent); color: #1b2a1a; }
.landing-cta .btn.primary:hover { background: var(--accent); text-decoration: none; }
.landing-cta .btn.secondary { background: var(--leaf-soft); border-color: var(--leaf); color: #1b2a1a; }
.landing-cta .btn.secondary:hover { background: var(--leaf); color: #fff; text-decoration: none; }

.landing-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.landing-footer p { margin: 0.3rem 0; }
.landing-footer a { color: var(--text-muted); }
.landing-footer .credit { font-size: 0.8rem; opacity: 0.7; }

.landing-examples { margin-bottom: 2.5rem; }
.landing-examples-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.landing-examples-header p { margin: 0; font-size: 0.88rem; color: var(--text-muted); }
.landing-examples-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  color: var(--text);
}
.example-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.example-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border);
}
.example-thumb.g1 { background: linear-gradient(135deg, var(--accent-soft), var(--leaf-soft)); }
.example-thumb.g2 { background: linear-gradient(135deg, var(--sky-soft), var(--accent-soft)); }
.example-thumb.g3 { background: linear-gradient(135deg, var(--leaf-soft), var(--sky-soft)); }
.example-meta {
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.example-meta .title { color: var(--text); font-weight: 500; font-size: 0.98rem; }
.example-meta .author { color: var(--text-muted); font-size: 0.8rem; font-family: "JetBrains Mono", ui-monospace, monospace; }
.example-meta .desc { color: var(--text-muted); font-size: 0.88rem; line-height: 1.4; }

.landing-workflow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.5rem;
}
.landing-workflow h2 { text-align: center; }
.workflow-caption {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0.25rem 0 1.25rem;
}
.workflow-top { display: grid; place-items: center; margin-bottom: 0.6rem; }
.workflow-down-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.5rem 0 0.5rem;
  color: var(--text-muted);
}
.workflow-down-arrow .arr { font-size: 1.5rem; line-height: 1; }
.workflow-down-arrow .lbl { font-size: 0.75rem; margin-top: 0.15rem; }
.workflow-main {
  display: grid;
  grid-template-columns: 1.5fr auto 1fr auto 0.7fr;
  gap: 0.6rem;
  align-items: stretch;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  min-height: 240px;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.app-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.app-card.cowork::before { background: linear-gradient(90deg, var(--accent), var(--accent-hover)); }
.app-card.design::before { background: linear-gradient(90deg, var(--sky), #4a74a8); }
.app-card.code::before   { background: linear-gradient(90deg, var(--leaf), var(--leaf-hover)); }
.app-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.app-card.primary {
  border-width: 1px;
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(213, 169, 58, 0.18);
  min-height: 320px;
}
.app-card.primary::before { height: 4px; }
.app-card.compact { min-height: 200px; width: 260px; }
.app-card.cowork .titlebar { background: linear-gradient(180deg, #fff4d2, #fbe9b0); }
.app-card.design .titlebar { background: linear-gradient(180deg, #eaf1fa, #d3e1f0); }
.app-card.code   .titlebar { background: linear-gradient(180deg, #e7f0e4, #cfe0cb); }
.app-card.tmuh {
  min-width: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(111, 154, 107, 0.18), transparent 60%),
    linear-gradient(135deg, #eaf3e6, #f8e8b9);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  font-weight: 600;
  padding: 1rem 0.5rem;
  font-size: 1rem;
  color: #1b2a1a;
  border: 1px solid var(--leaf);
  gap: 0.4rem;
}
.app-card.tmuh::before { background: linear-gradient(90deg, var(--leaf), var(--accent)); }
.app-card.tmuh .tmuh-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--leaf-hover);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.app-card.tmuh .tmuh-live::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 0 rgba(111, 154, 107, 0.7);
  animation: tmuhPulse 1.8s ease-out infinite;
}
@keyframes tmuhPulse {
  0%   { box-shadow: 0 0 0 0 rgba(111, 154, 107, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(111, 154, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 154, 107, 0); }
}
.app-card.tmuh .tmuh-domain { font-size: 1.15rem; letter-spacing: 0.01em; }

.titlebar {
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 0.85rem;
  font-weight: 500;
}
.titlebar .dots { display: inline-flex; gap: 0.3rem; }
.titlebar .dots i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.titlebar .dots i:nth-child(1) { background: #ff5f57; }
.titlebar .dots i:nth-child(2) { background: #febc2e; }
.titlebar .dots i:nth-child(3) { background: #28c840; }
.titlebar .role { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }

.app-body {
  display: grid;
  grid-template-columns: 90px 1fr;
  flex: 1;
  min-height: 150px;
}
.sidebar {
  background: var(--surface-sunk);
  padding: 0.55rem 0.45rem;
  border-right: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex; flex-direction: column; gap: 0.3rem;
}
.sb-item { padding: 0.3rem 0.45rem; border-radius: var(--radius-sm); }
.sb-item.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.app-content {
  padding: 0.8rem;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.bubble {
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  max-width: 92%;
  line-height: 1.4;
}
.bubble.user { background: var(--accent-soft); align-self: flex-end; border-top-right-radius: 3px; }
.bubble.ai   { background: var(--surface-sunk); align-self: flex-start; border-top-left-radius: 3px; }
.design-preview {
  background: var(--surface-sunk);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.4rem;
  flex: 1;
}
.design-shape {
  background: var(--sky-soft);
  border: 1px solid var(--sky);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--sky);
  font-size: 0.85rem;
}
.design-shape.circle { border-radius: 50%; grid-row: span 2; }
.terminal {
  background: #1c1f1a;
  color: #b7d8a8;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  line-height: 1.6;
  flex: 1;
}
.terminal .prompt { color: #6f9a6b; }
.terminal .ok { color: #a7cf7a; }

.arrow-h {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0 0.25rem;
}
.arrow-h small { font-size: 0.68rem; margin-top: 0.2rem; text-align: center; max-width: 90px; }

.landing-features { margin-bottom: 2.5rem; }
.landing-features h2 { text-align: center; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.feature-tile {
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.35rem;
}
.feature-tile.t1 { background: var(--accent-soft); }
.feature-tile.t2 { background: var(--sky-soft); }
.feature-tile.t3 { background: var(--leaf-soft); }
.feature-tile.t4 { background: var(--surface-sunk); }
.feature-tile .icon { font-size: 1.6rem; }
.feature-tile .title { font-weight: 600; font-size: 1rem; }
.feature-tile .desc { color: #3c3628; font-size: 0.88rem; line-height: 1.5; }

.landing-steps {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.5rem;
}
.landing-steps h2 { margin-top: 0; }
.landing-steps ol {
  counter-reset: step;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
  margin: 1rem 0 0;
}
.landing-steps ol li {
  counter-increment: step;
  padding-left: 3rem;
  position: relative;
}
.landing-steps ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 2rem; height: 2rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  color: #1b2a1a;
  font-size: 0.95rem;
}
.landing-steps ol li strong { color: var(--leaf-hover); display: block; margin-bottom: 0.2rem; font-size: 1rem; }
.landing-steps ol li p { margin: 0; color: var(--text-muted); font-size: 0.92rem; line-height: 1.55; }

.landing-request {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}
.landing-request h2 { margin-top: 0; font-size: 1.2rem; }
.landing-request form { display: grid; gap: 0.75rem; max-width: 100%; }
.landing-request label { display: grid; gap: 0.3rem; font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }
.landing-request button {
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  color: #1b2a1a;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  width: fit-content;
}
.landing-request button:hover { background: var(--accent); }
.landing-request .honeypot { position: absolute; left: -9999px; }
.landing-request .status { color: var(--text-muted); font-size: 0.88rem; min-height: 1.2em; margin: 0; }
.landing-request .status.error { color: var(--danger); }

@media (max-width: 960px) {
  .landing-examples-grid { grid-template-columns: repeat(2, 1fr); }
  .workflow-main { grid-template-columns: 1.4fr auto 1fr auto 0.6fr; }
  .app-card.primary { min-height: 290px; }
}
@media (max-width: 760px) {
  .landing-examples-grid { grid-template-columns: 1fr; }
  .workflow-main { grid-template-columns: 1fr; gap: 0.5rem; }
  .arrow-h { transform: rotate(90deg); padding: 0.5rem 0; }
  .arrow-h small { transform: rotate(-90deg); margin: 0.4rem 0 0; }
  .features-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .landing-hero { padding: 1rem 0.25rem 0.25rem; }
  .landing-hero h1 { font-size: 1.75rem; }
  .landing-hero .sub { font-size: 0.98rem; }
}
