/* ===== 基礎與字型 ===== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #09090b; /* 極致深色背景 */
    color: #f8fafc;
    -webkit-tap-highlight-color: transparent;
}

/* 隱藏數字輸入框的上下箭頭 */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

/* ===== 卡片與輸入框 ===== */
.glass-card {
    background: rgba(24, 24, 27, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.input-field {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s ease;
}

.input-field:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    outline: none;
}

/* 輸入錯誤狀態 */
.input-field.input-error {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* ===== 台股漲跌顏色(紅漲綠跌) ===== */
.text-up { color: #ef4444; }   /* 紅色 */
.text-down { color: #22c55e; } /* 綠色 */
.bg-up { background-color: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); }
.bg-down { background-color: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.2); }

/* ===== 做多/做空切換開關 ===== */
.toggle-btn.active-long { background: #ef4444; color: white; border-color: #ef4444; }
.toggle-btn.active-short { background: #22c55e; color: white; border-color: #22c55e; }

/* 稅率模式切換(藍色,與紅綠做多做空區隔) */
.toggle-btn.active-tax { background: #3b82f6; color: white; border-color: #3b82f6; }

/* 商品類型切換(靛色,股票/ETF 檔差不同) */
.toggle-btn.active-inst { background: #6366f1; color: white; border-color: #6366f1; }

/* 停用狀態(如隔日沖時的做空鈕) */
.toggle-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 頁籤 ===== */
.tab-btn {
    color: #94a3b8;
    border-bottom: 2px solid transparent;
    padding-bottom: 0.5rem;
    transition: all 0.3s ease;
}
.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 600;
}

/* ===== 快速籌碼 / 檔數切換 ===== */
.chip {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    transition: all 0.2s ease;
}
.chip:hover { color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.chip.active { background: #3b82f6; border-color: #3b82f6; color: #fff; font-weight: 600; }

/* ===== 矩陣標記徽章 ===== */
.badge {
    font-size: 9px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}

/* ===== 獲利時的目標數字微光 ===== */
@keyframes softGlow {
    0%, 100% { text-shadow: 0 0 0 transparent; }
    50% { text-shadow: 0 0 14px rgba(239, 68, 68, 0.45); }
}
.glow-up { animation: softGlow 2.4s ease-in-out infinite; }
