:root {
  --bg: #f3f6f9;
  --card: #ffffff;
  --text: #15202b;
  --muted: #657786;
  --primary: #1769aa;
  --primary-dark: #0f4f84;
  --danger: #b42318;
  --border: #d8e0e7;
  --success: #137333;
  --shadow: 0 8px 24px rgba(16, 24, 40, .08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  padding: 18px 14px 40px;
}

.container {
  width: min(720px, 100%);
  margin: 0 auto;
}

.header {
  margin-bottom: 18px;
}

.header h1 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.3;
}

.subtitle {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-weight: 800;
  margin: 0 0 8px;
}

input, select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 17px;
  background: #fff;
  color: var(--text);
  margin-bottom: 14px;
}

button, .button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 13px;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  padding: 12px 16px;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: #e7f0f8;
  color: #0e4f80;
}

.danger {
  background: #fde8e7;
  color: var(--danger);
}

.row {
  display: flex;
  gap: 10px;
}

.row > * {
  flex: 1;
}

.message {
  display: none;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.message.show {
  display: block;
}

.message.error {
  background: #feeceb;
  color: #8a1c13;
}

.message.success {
  background: #e8f5eb;
  color: var(--success);
}

.info-list {
  display: grid;
  gap: 8px;
  font-size: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f4;
}

.info-item:last-child {
  border-bottom: 0;
}

.muted {
  color: var(--muted);
}

.code-box {
  background: #eef4f8;
  border: 1px dashed #9db2c2;
  border-radius: 12px;
  padding: 12px;
  overflow-wrap: anywhere;
  font-family: Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
}

.team-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.badge.active {
  background: #e7f5ea;
  color: #137333;
}

.member-list {
  display: grid;
  gap: 10px;
}

.member-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
}

.member-name {
  font-weight: 900;
  font-size: 17px;
}

.small {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

@media (max-width: 520px) {
  body {
    padding: 12px 10px 28px;
  }

  .card {
    border-radius: 15px;
    padding: 15px;
  }

  .row {
    flex-direction: column;
  }

  .header h1 {
    font-size: 23px;
  }
}
.connection-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  margin-bottom: 14px;
  font-weight: 900;
}

.connection-panel.online {
  background: #e8f5eb;
  color: #137333;
}

.connection-panel.temporary_offline {
  background: #fff5d9;
  color: #8a5a00;
}

.connection-panel.offline {
  background: #edf0f2;
  color: #4c5760;
}

.presence-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
}

.presence-dot.online {
  background: #1a9b44;
}

.presence-dot.temporary_offline {
  background: #e0a000;
}

.presence-dot.offline {
  background: #7b8790;
}

.presence-label {
  font-weight: 900;
}

.member-presence {
  margin-top: 7px;
  font-size: 14px;
}
