* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
  background-color: #0d131f;
  color: #f1f5f9;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 20px 16px 40px;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
}

/* 頂部導航 */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 36px; /* 增加與主卡片的距離 */
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.icon-menu {
  width: 26px;
  height: 26px;
  stroke: #e2e8f0;
}

.nav-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #f8fafc;
}

/* 側邊欄抽屜 */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 82%;
  max-width: 320px;
  background: #141c2e;
  border-right: 1px solid #1e293b;
  z-index: 101;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 14px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-label {
  font-size: 0.78rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.drawer-value {
  font-size: 0.95rem;
  color: #f8fafc;
  word-break: break-all;
}

.account-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.account-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #0d131f;
  border-radius: 8px;
  border: 1px solid #1e293b;
  cursor: pointer;
}

.account-item.active {
  border-color: #2563eb;
  background: #1e293b;
}

.account-item-user {
  font-size: 0.92rem;
  font-weight: 500;
}

.account-item-del {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 1.2rem;
}

.drawer-footer {
  margin-top: auto;
  padding-top: 12px;
}

.btn-icon {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

/* 卡片與表單排版修復 */
.card {
  background: #141c2e;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #f8fafc;
}

.desc {
  font-size: 0.9rem;
  color: #94a3b8;
  margin: 8px 0 22px; /* 增加下方與輸入框的距離 */
  line-height: 1.45;
}

/* 修復：為輸入框容器提供明確的垂直邊距與高度 */
.input-group {
  display: flex;
  align-items: center;
  background: #0d131f;
  border: 1px solid #2d3b55;
  border-radius: 10px;
  padding: 4px 14px;
  margin-bottom: 20px; /* 徹底解決按鈕與輸入框貼緊問題 */
}

.input-group:focus-within {
  border-color: #2563eb;
}

input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  padding: 12px 0;
  font-size: 1rem;
}

#otpInput, #importInput {
  background: #0d131f;
  border: 1px solid #2d3b55;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 20px;
  font-size: 1rem;
}

#otpInput:focus, #importInput:focus {
  border-color: #2563eb;
}

.suffix {
  color: #64748b;
  font-size: 0.95rem;
  user-select: none;
}

.text-link {
  color: #60a5fa;
  font-size: 0.88rem;
  text-decoration: none;
  padding: 4px;
}

/* 按鈕風格 */
.btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:active {
  opacity: 0.85;
  transform: scale(0.99);
}

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

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: #1b263b;
  color: #38bdf8;
  border: 1px solid #2e4469;
}

.btn-action {
  background: #2563eb;
  color: #ffffff;
  border-radius: 10px;
  padding: 15px;
  margin-top: 18px;
  font-size: 1.05rem;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.btn-outline {
  background: transparent;
  border: 1px dashed #475569;
  color: #cbd5e1;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* 主面板地址欄位 */
.field-group {
  margin-bottom: 26px;
}

.field-group label {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.address-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.address-text {
  font-size: 1.25rem;
  font-weight: 500;
  word-break: break-all;
  color: #f8fafc;
}

.btn-copy {
  flex-shrink: 0;
  background: #1e3a5f;
  color: #e2e8f0;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy.copied {
  background: #166534;
  color: #86efac;
}

.stats-counter {
  text-align: center;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-top: 16px;
}

/* 提示方塊 */
.info-box {
  border-radius: 12px;
  padding: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 18px;
}

.green-box {
  background-color: #162a2a;
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.yellow-box {
  background-color: #2e2619;
  color: #d4a359;
  border: 1px solid rgba(212, 163, 89, 0.2);
}

/* 彈窗樣式 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 150;
}

.modal-content {
  background: #141c2e;
  border: 1px solid #2d3b55;
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  padding: 22px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.qrcode-wrapper {
  background: #ffffff;
  padding: 14px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px auto;
  width: 208px;
  height: 208px;
}

.hidden {
  display: none !important;
}