* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root { --bg: #0C0B0A; --surface: #161412; --gold: #C8A96A; --gold-soft: rgba(200, 169, 106, 0.15); --green: #4A6B5A; --text: #F5F0E8; --text-sub: #A8A29E; --line: rgba(255,255,255,0.08); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, sans-serif; min-height: 100dvh; display: flex; justify-content: center; overflow-x: hidden; }
.glow { position: fixed; inset: 0; z-index: -1; background: radial-gradient(circle at 50% 0%, rgba(200, 169, 106, 0.04) 0%, transparent 60%); }
.app { width: 100%; max-width: 440px; padding: 24px; display: flex; flex-direction: column; gap: 24px; min-height: 100dvh; }
.nav { display: flex; align-items: center; justify-content: space-between; }
.logo { width: 36px; height: 36px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--gold); font-weight: 800; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.brand { font-size: 16px; font-weight: 700; margin-left: 12px; }
.btn-top { background: transparent; border: 1px solid var(--line); color: var(--text); padding: 8px 16px; border-radius: 20px; font-size: 13px; cursor: pointer; }
.btn-top.out { color: #E57373; border-color: rgba(229, 115, 115, 0.2); }
#view { display: flex; flex-direction: column; gap: 24px; flex: 1; }

/* 组件 */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px; }
.hero { padding: 48px 0 24px 0; text-align: center; }
.hero h1 { font-size: 42px; line-height: 1.3; font-weight: 800; margin: 0; }
.hero span { color: var(--gold); font-weight: 300; font-style: italic; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cell { background: transparent; border: 1px solid var(--line); border-radius: 16px; padding: 20px 16px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.cell .val { font-size: 24px; font-weight: 600; font-family: monospace; }
.cell .lbl { font-size: 12px; color: var(--text-sub); }
.btn-main { grid-column: span 2; padding: 18px; border: none; font-size: 16px; font-weight: 700; color: var(--bg); background: var(--gold); border-radius: 16px; cursor: pointer; margin-top: 8px; }

/* 控制台 */
.traffic { display: flex; justify-content: space-between; align-items: flex-end; }
.t-val { font-size: 36px; font-weight: 700; }
.progress { height: 4px; background: rgba(255,255,255,0.05); border-radius: 2px; margin-top: 16px; }
.progress div { height: 100%; width: 13.6%; background: var(--gold); border-radius: 2px; }
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.item { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 20px 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.item .icon { font-size: 20px; filter: grayscale(1); opacity: 0.6; }
.item .name { font-size: 15px; font-weight: 600; }
.item .desc { font-size: 12px; color: var(--text-sub); }

/* 节点列表 */
.node { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; margin-bottom: 12px; }
.node.on { border-color: var(--gold); background: var(--gold-soft); }
.node-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.node-meta { font-size: 12px; color: var(--text-sub); display: flex; gap: 12px; }
.node-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); }
.node.on .node-check { border-color: var(--gold); background: var(--gold); }

/* 弹窗 */
.modal { display: none; position: fixed; inset: 0; background: rgba(12,11,10,0.85); backdrop-filter: blur(12px); z-index: 100; align-items: center; justify-content: center; padding: 24px; }
.modal-box { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px 24px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { flex: 1; text-align: center; padding: 10px 0; font-size: 15px; color: var(--text-sub); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.on { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }
.inp { width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 16px; border-radius: 12px; font-size: 15px; margin-bottom: 12px; outline: none; }
.row { display: flex; gap: 8px; }
.cap { width: 100px; height: 50px; background: #F5F0E8; border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-send { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 12px; font-size: 13px; width: 100px; cursor: pointer; }
.rem { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-sub); cursor: pointer; margin: 4px 0 16px 0; }
.btn-sub { width: 100%; padding: 18px; border-radius: 14px; font-size: 16px; font-weight: 700; background: var(--gold); color: var(--bg); border: none; cursor: pointer; }
.switch { display: block; text-align: center; color: var(--text-sub); font-size: 14px; margin-top: 20px; cursor: pointer; }
.err { color: #E57373; font-size: 13px; text-align: center; margin-bottom: 12px; }

/* 强制正方形 Bento */
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.item { 
  background: var(--bg); border: 1px solid var(--line); border-radius: 20px; 
  padding: 16px; display: flex; flex-direction: column; justify-content: space-between; 
  cursor: pointer; aspect-ratio: 1 / 1; /* 这里强制正方形！ */
}
.item:active { transform: scale(0.96); transition: 0.2s; }
.item .icon { font-size: 24px; filter: grayscale(1); opacity: 0.8; }
.item .name { font-size: 16px; font-weight: 700; margin-top: auto; }
.item .desc { font-size: 12px; color: var(--text-sub); margin-top: 4px; }

/* 节点选择里的正方形 */
.node { 
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; 
  padding: 20px; display: flex; justify-content: space-between; align-items: center; 
  cursor: pointer; margin-bottom: 12px; 
}



.cell-wide {
  grid-column: span 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  margin-top: 4px;
  transition: border-color 0.2s;
}
.cell-wide:active { border-color: var(--gold); }
.cell-wide .icon { font-size: 28px; margin-right: 16px; }
.cell-wide .text { flex: 1; }
.cell-wide .text .name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.cell-wide .text .desc { font-size: 12px; color: var(--text-sub); }
.cell-wide .arrow { color: var(--gold); font-size: 20px; }

/* === Settings Page === */
.section-title { font-size: 14px; color: var(--gold); margin: 24px 0 12px; font-weight: 600; letter-spacing: 1px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.setting-row:last-child { border-bottom: none; }
.setting-row input { background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 8px 12px; border-radius: 8px; text-align: right; width: 60%; font-size: 14px; }
.setting-btn { background: var(--gold); color: var(--bg); border: none; padding: 10px 20px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; }
.qr-preview { width: 120px; height: 120px; border-radius: 12px; border: 1px dashed var(--line); object-fit: cover; display: block; margin: 12px auto; }


