:root{
  --bg: #0b1020;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.085);
  --stroke: rgba(255,255,255,.12);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.72);
  --muted2: rgba(255,255,255,.56);
  --good: #39d98a;
  --warn: #ffb020;
  --bad: #ff4d4f;
  --brand: #7c5cff;
  --brand2: #00d4ff;
  --shadow: 0 14px 40px rgba(0,0,0,.45);
  --radius: 18px;
}

*{box-sizing:border-box}
html,body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);

  /* === MODIFIED SECTION ===
     Originally:
     Three relatively strong radial gradients caused visible color boundaries
     between purple and green areas.

     Changed to:
     1. Increased gradient size
     2. Reduced opacity
     3. Added a large soft neutral blending layer
     This creates smoother color transitions with less visible edge overlap.
  */

  background:
    /* soft global blending layer */
    radial-gradient(1400px 900px at 50% 60%, rgba(20,24,40,.55), transparent 70%),

    /* top-left purple glow (softer + larger) */
    radial-gradient(1200px 700px at 18% 8%, rgba(124,92,255,.28), transparent 65%),

    /* top-right blue glow (softer) */
    radial-gradient(1000px 600px at 82% 18%, rgba(0,212,255,.18), transparent 65%),

    /* bottom green glow (much softer + wider fade) */
    radial-gradient(1200px 800px at 50% 95%, rgba(57,217,138,.10), transparent 72%),

    /* base dark gradient */
    linear-gradient(180deg, #070a14 0%, #0b1020 35%, #0a1024 100%);

  overflow-x:hidden;
}

.topbar{
  position: sticky;
  top:0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(11,16,32,.82), rgba(11,16,32,.55));
  border-bottom: 1px solid var(--stroke);
}
.topbar .inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 220px;
}
/* .logo{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,92,255,1), rgba(0,212,255,1));
  box-shadow: 0 10px 26px rgba(124,92,255,.25);
  position:relative;
  overflow:hidden;
} */
.logo {
  width: 40px;
  height: 40px;
  background: url("page_icon.png") center/contain no-repeat;
}

.logo:after{
  content:"";
  position:absolute;
  inset:-40% -10%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.55), transparent 52%);
  transform: rotate(18deg);
}
.brand h1{
  font-size: 14px;
  margin:0;
  letter-spacing:.2px;
  font-weight: 700;
}
.brand p{
  margin:0;
  font-size: 12px;
  color: var(--muted2);
}
.right-meta{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.dot{
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--good);
  box-shadow: 0 0 0 6px rgba(57,217,138,.12);
}

.wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 18px 48px;
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 18px;
}

@media (max-width: 980px){
  .wrap{grid-template-columns:1fr;}
  .brand{min-width:auto;}
}

.card{
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.05));
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow:hidden;
}
.card .hd{
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.card .hd h2{
  margin:0;
  font-size: 14px;
  letter-spacing:.2px;
  font-weight: 750;
}
.card .hd p{
  margin:6px 0 0;
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.45;
}
.card .bd{padding: 16px;}

.grid{display:grid;grid-template-columns:1fr;gap:14px;}

.field{display:flex;flex-direction:column;gap:8px;}
label{font-size: 12px;color: var(--muted);}
.help{font-size: 12px;color: var(--muted2);}

.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}

.input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.28);
  color: var(--text);
  outline:none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.input:focus{
  border-color: rgba(124,92,255,.7);
  box-shadow: 0 0 0 4px rgba(124,92,255,.18);
}

.btn{
  cursor:pointer;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 12px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .2px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  transition: transform .06s ease, background .18s ease, border-color .18s ease;
  user-select:none;
}
.btn:hover{background: rgba(255,255,255,.085);}
.btn:active{transform: translateY(1px);}

.btn.primary{
  border-color: rgba(124,92,255,.55);
  background: linear-gradient(135deg, rgba(124,92,255,.92), rgba(0,212,255,.35));
}
.btn.primary:hover{filter: brightness(1.03);}

.btn.ghost{background: transparent;border-color: rgba(255,255,255,.12);color: var(--muted);}

.btn.danger{
  border-color: rgba(255,77,79,.5);
  background: rgba(255,77,79,.12);
  color: rgba(255,255,255,.92);
}

.btn.small{padding: 8px 10px;border-radius: 10px;font-size: 12px;font-weight: 750;}

.split{display:grid;grid-template-columns: 1fr auto;gap:10px;align-items:end;}

@media (max-width: 520px){
  .split{grid-template-columns:1fr; align-items:stretch;}
  .right-meta{gap:8px;}
}

.divider{height: 1px;background: rgba(255,255,255,.08);margin: 12px 0;}

.list{display:flex;flex-direction:column;gap:10px;}

.stock-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  transition: transform .14s ease, opacity .14s ease;
}
.stock-item.removing{opacity: 0;transform: translateX(10px);}

.stock-left{display:flex;flex-direction:column;gap:4px;min-width: 0;}
.ticker{font-weight: 900;letter-spacing: .5px;font-size: 13px;}
.name{font-size: 12px;color: var(--muted2);white-space: nowrap;overflow:hidden;text-overflow: ellipsis;max-width: 520px;}

.limit{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.045);
}

.bar{
  height: 8px;
  width: 100%;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.09);
}
.bar > i{
  display:block;
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(124,92,255,1), rgba(0,212,255,1));
  border-radius: 999px;
  transition: width .2s ease;
}

.kpi{display:flex;flex-direction:column;gap:4px;min-width: 130px;text-align:right;}
.kpi .big{font-weight: 900;letter-spacing: .3px;font-size: 13px;}
.kpi .small{font-size: 12px;color: var(--muted2);}

.schedule-box{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
}

select.input{appearance:none;}

.select-wrap{position:relative; width:100%;}
.select-wrap:after{
  content:"▾";
  position:absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.65);
  pointer-events:none;
  font-size: 12px;
}

.toast-host{
  position: fixed;
  right: 14px;
  bottom: 14px;
  display:flex;
  flex-direction:column;
  gap:10px;
  z-index: 999;
  max-width: min(420px, calc(100vw - 28px));
}
.toast{
  border-radius: 14px;
  padding: 12px 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(11,16,32,.72);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 55px rgba(0,0,0,.55);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  animation: pop .16s ease;
}
@keyframes pop{from{transform: translateY(6px); opacity:.0;} to{transform: translateY(0); opacity:1;}}

.toast .msg{display:flex; gap:10px; align-items:flex-start;}
.badge{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 5px;
  background: var(--brand);
  box-shadow: 0 0 0 6px rgba(124,92,255,.14);
  flex: 0 0 auto;
}
.toast.warn .badge{background: var(--warn); box-shadow: 0 0 0 6px rgba(255,176,32,.14);}
.toast.bad  .badge{background: var(--bad);  box-shadow: 0 0 0 6px rgba(255,77,79,.14);}
.toast.good .badge{background: var(--good); box-shadow: 0 0 0 6px rgba(57,217,138,.14);}

.toast h3{margin:0; font-size: 13px; font-weight: 900; letter-spacing:.2px;}
.toast p{margin:3px 0 0; font-size: 12px; color: var(--muted2); line-height:1.45;}

.toast button{
  border:none;
  background: transparent;
  color: rgba(255,255,255,.7);
  cursor:pointer;
  padding: 2px 6px;
  font-size: 16px;
  line-height: 1;
}

.hint{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.hint strong{color: rgba(255,255,255,.9)}

.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* API 加載中的按鈕狀態 */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

/* 讓 Ticker 顯示更明顯一點 */
.ticker.mono {
  background: rgba(124, 92, 255, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--brand);
  font-weight: 700;
}