:root {
  --bg: #000000;
  --fg: #ffffff;
  --muted: #cccccc;
  --border: #333333;
  --accent: #ffffff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  background: #000;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #444;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.btn.primary {
  background: #fff;
  color: #000;
  border-color: #fff;
  font-weight: 600;
}

main {
  flex: 1;
  min-height: 0;
}

.view {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
}

.hidden {
  display: none !important;
}

#dshFrame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.status {
  color: var(--muted);
  font-size: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  width: min(92vw, 420px);
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-content h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.modal-content label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.modal-content input {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #333;
  background: #000;
  color: #fff;
  font-size: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.hint {
  font-size: 12px;
  color: #888;
  margin: 4px 0 0;
}

/* 顶部按钮组 */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 浅色模式 */
:root[data-theme="light"] {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #555555;
  --border: #dddddd;
  --accent: #000000;
}

:root[data-theme="light"] .topbar {
  background: #ffffff;
  border-bottom-color: #dddddd;
}

:root[data-theme="light"] .title {
  color: #000000;
}

:root[data-theme="light"] .btn {
  background: #f0f0f0;
  color: #000000;
  border-color: #cccccc;
}

:root[data-theme="light"] .btn.primary {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

:root[data-theme="light"] .modal-content {
  background: #ffffff;
  border-color: #dddddd;
}

:root[data-theme="light"] .modal-content input {
  background: #ffffff;
  color: #000000;
  border-color: #dddddd;
}

:root[data-theme="light"] .modal-content label {
  color: #555555;
}

:root[data-theme="light"] #dshFrame {
  background: #ffffff;
}
