/* ☆ 自選按鈕（全站）＋ 我的自選頁（紅漲綠跌，深色） */
.sp-star { background: none; border: 0; padding: 0 5px 0 0; margin: 0; cursor: pointer; color: #6b7385; font-size: 15px; line-height: 1; vertical-align: -1px; }
.sp-star:hover { color: #f5c542; background: none; }
.sp-star.on { color: #f5c542; }
.sp-star.big { font-size: 20px; padding: 0 0 0 8px; vertical-align: -2px; }
.sp-star:disabled { opacity: .5; }
.sp-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #262b3d; color: #e6e8ee; border: 1px solid #3a4260;
	border-radius: 10px; padding: 10px 16px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none;
	transition: all .2s; z-index: 99999; max-width: calc(100vw - 32px); }
.sp-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.sp-toast a { color: #6ea2ff; margin-left: 12px; text-decoration: none; font-weight: 600; }

.sp-wl {
	--sp-bg: #131722; --sp-card: #1c2030; --sp-line: #2f354b; --sp-grid: #272d42;
	--sp-text: #e6e8ee; --sp-mute: #848e9c; --sp-up: #f0443a; --sp-dn: #16b36b; --sp-acc: #4e8cff;
	background: var(--sp-bg); color: var(--sp-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
	padding: 20px; border-radius: 12px; box-sizing: border-box; display: flex; flex-direction: column; gap: 20px;
}
.sp-wl *, .sp-wl *::before, .sp-wl *::after { box-sizing: border-box; }
.sp-wl .sp-card { background: var(--sp-card); border: 1px solid var(--sp-line); border-radius: 10px; padding: 16px 18px; min-width: 0; }
.sp-wl .sp-card[hidden] { display: none; }
.sp-wl .sp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sp-wl h2 { margin: 0; font-size: 18px; color: #fff; font-weight: 700; }
.sp-wl .sp-meta { color: var(--sp-mute); font-size: 12px; font-weight: 400; margin: 0; }
.sp-wl .sp-meta a { color: #6ea2ff; }
.sp-wl .sp-note { color: var(--sp-mute); font-size: 12px; margin: 10px 0 0; }
.sp-wl .sp-up { color: var(--sp-up); }
.sp-wl .sp-dn { color: var(--sp-dn); }
.sp-wl .na { color: #4b5263; }
.sp-wl a { color: inherit; text-decoration: none; }
.sp-wl-empty { text-align: center; padding: 40px 16px !important; }
.sp-wl-empty a { color: #6ea2ff !important; font-weight: 600; }

.sp-wl .sp-seg { display: inline-flex; border: 1px solid var(--sp-line); border-radius: 6px; overflow: hidden; }
.sp-wl .sp-seg button { background: transparent; color: var(--sp-mute); border: 0; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; border-radius: 0; }
.sp-wl .sp-seg button + button { border-left: 1px solid var(--sp-line); }
.sp-wl .sp-seg button.on { background: var(--sp-acc); color: #fff; }

/* 搜尋 */
.sp-wl-search { position: relative; flex: 1 1 320px; max-width: 460px; }
.sp-wl-search input { width: 100%; background: #131722; border: 1px solid var(--sp-line); border-radius: 8px; color: #fff; padding: 9px 12px; font-size: 14px; }
.sp-wl-search input:focus { outline: none; border-color: var(--sp-acc); }
.sp-wl-drop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #1f2436; border: 1px solid #3a4260; border-radius: 8px;
	max-height: 420px; overflow-y: auto; z-index: 50; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.sp-wl-drop .it { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--sp-grid); }
.sp-wl-drop .it:last-child { border-bottom: 0; }
.sp-wl-drop .it.on, .sp-wl-drop .it[data-t]:hover { background: #2a3150; }
.sp-wl-drop .it b { color: #fff; min-width: 64px; }
.sp-wl-drop .it span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b7bdc8; }
.sp-wl-drop .it em { font-style: normal; color: var(--sp-mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sp-wl-drop .it u { text-decoration: none; font-size: 12px; color: var(--sp-mute); white-space: nowrap; }
.sp-wl-drop .it u.add { color: #6ea2ff; font-weight: 600; }
.sp-wl .mk { font-style: normal; font-size: 10px; padding: 1px 5px; border-radius: 4px; margin-right: 6px; white-space: nowrap; vertical-align: 1px; }
.sp-wl .mk-TW { background: rgba(240, 68, 58, .18); color: #ff8a80; }
.sp-wl .mk-JP { background: rgba(224, 86, 155, .18); color: #f08cbf; }
.sp-wl .mk-KR { background: rgba(46, 197, 211, .18); color: #6fdde6; }
.sp-wl .mk-US { background: rgba(78, 140, 255, .18); color: #8db4ff; }

/* 摘要 */
.sp-wl-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.sp-wl-sum > div { background: #131722; border: 1px solid var(--sp-line); border-radius: 8px; padding: 12px 14px; }
.sp-wl-sum > div > span { display: block; color: var(--sp-mute); font-size: 12px; margin-bottom: 4px; }
.sp-wl-sum b { font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; }
.sp-wl-sum small { margin-left: 8px; font-size: 13px; }
.sp-wl-sum .sp-wl-hint { grid-column: 1 / -1; color: var(--sp-mute); font-size: 14px; }

/* 表格 */
.sp-wl-scroll { overflow-x: auto; }
.sp-wl-tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; margin: 0; }
.sp-wl-tbl th, .sp-wl-tbl td { padding: 7px 8px; border: 0; border-bottom: 1px solid var(--sp-grid); text-align: right; background: transparent; vertical-align: middle; }
.sp-wl-tbl th { color: var(--sp-mute); font-weight: 600; font-size: 12px; }
.sp-wl-tbl th[data-k] { cursor: pointer; user-select: none; }
.sp-wl-tbl th[data-k]:hover, .sp-wl-tbl th.sorted { color: #fff; }
.sp-wl-tbl th.sorted::after { content: attr(data-dir); margin-left: 3px; font-size: 10px; }
.sp-wl-tbl .l { text-align: left; }
.sp-wl-tbl td.nm a { display: inline-block; vertical-align: middle; }
.sp-wl-tbl td.nm b { color: #fff; }
.sp-wl-tbl td.nm small { display: block; color: var(--sp-mute); font-size: 11px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.sp-wl-tbl td.nm a:hover b { text-decoration: underline; }
.sp-wl-tbl td.b { font-weight: 700; }
.sp-wl-tbl td.b small { display: block; color: var(--sp-mute); font-size: 10px; font-weight: 400; }
.sp-wl-tbl td.d { color: var(--sp-mute); font-size: 12px; }
.sp-wl-tbl small.cc { color: var(--sp-mute); font-size: 10px; }
.sp-wl-tbl td.op { white-space: nowrap; }
.sp-wl-tbl td.op button, .sp-wl-edit button { background: #2a3150; color: #dfe3ec; border: 0; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; margin-left: 4px; }
.sp-wl-tbl td.op button:hover { background: #343c5f; }
.sp-wl-tbl td.op .b-del { background: transparent; color: #6b7385; padding: 4px 6px; }
.sp-wl-tbl td.op .b-del:hover { color: var(--sp-up); background: transparent; }
.sp-wl-tbl tr:hover td { background: rgba(255, 255, 255, .02); }
.sp-sig { font-size: 12px; white-space: nowrap; }
.sp-sig.g { color: #6fdcab; }
.sp-sig.o { color: #f5a623; }
.sp-sig.d { color: var(--sp-mute); }
.sp-wl-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 6px 0; white-space: normal; }
.sp-wl-edit b { color: #fff; }
.sp-wl-edit label { display: inline-flex; align-items: center; gap: 6px; color: #b7bdc8; font-size: 13px; }
.sp-wl-edit input { width: 130px; background: #131722; border: 1px solid var(--sp-line); border-radius: 6px; color: #fff; padding: 6px 8px; font-size: 14px; }
.sp-wl-edit input:focus { outline: none; border-color: var(--sp-acc); }
.sp-wl-edit .b-save { background: var(--sp-acc); color: #fff; font-weight: 600; padding: 6px 14px; }
.sp-wl-edit .b-cancel { padding: 6px 12px; }

/* 配置＋走勢 */
.sp-wl-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 20px; }
.sp-wl-pie { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.sp-wl-pie svg { width: 180px; height: 180px; flex: 0 0 auto; }
.sp-wl-pie svg path:hover { opacity: .85; }
.sp-wl-pie .t1 { fill: var(--sp-mute); font-size: 11px; }
.sp-wl-pie .t2 { fill: #fff; font-size: 15px; font-weight: 700; }
.sp-wl-pie ul { list-style: none; margin: 0; padding: 0; flex: 1 1 160px; min-width: 0; font-size: 13px; }
.sp-wl-pie li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.sp-wl-pie li i { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.sp-wl-pie li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b7bdc8; }
.sp-wl-pie li b { color: #fff; font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }
.sp-wl-pie li span { min-width: 3.5em; }
.sp-wl-pie li em { flex: 0 0 auto; font-style: normal; color: #b7bdc8; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-wl-chart { height: 260px; }
.sp-wl-chart.empty { height: 60px; }
.sp-wl-chart.empty::before { content: "設定持股後會顯示走勢。"; color: #4b5263; font-size: 13px; }

@media (max-width: 900px) {
	.sp-wl-grid { grid-template-columns: 1fr; }
	.sp-wl-sum { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.sp-wl { padding: 10px; gap: 12px; }
	.sp-wl .sp-card { padding: 12px; }
	.sp-wl-sum b { font-size: 17px; }
	.sp-wl-sum small { display: block; margin: 2px 0 0; }
}

/* 主選單間距 */
@media (min-width: 922px) {
	#ast-hf-menu-1 > .menu-item > .menu-link { padding-left: 9px !important; padding-right: 9px !important; }
}
