/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #141a35;
    --bg-card: #1a2140;
    --text-primary: #e8eaf6;
    --text-secondary: #9fa8da;
    --accent-blue: #4A9EFF;
    --accent-purple: #9D4EDD;
    --accent-red: #FF5252;
    --accent-green: #4CAF50;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.title-link {
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s ease;
}

.title-link:hover {
    transform: translateY(-2px);
}

.title-link:active {
    transform: translateY(0);
}

.icon {
    font-size: 32px;
    filter: drop-shadow(0 0 10px rgba(74, 158, 255, 0.5));
}

.logo {
    font-size: 36px;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.6));
    animation: logoFloat 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }
}


.update-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* 标签页 */
.tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-btn:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.tab-btn.active {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.tab-btn.active::before {
    opacity: 0.1;
}

.tab-name {
    font-size: 16px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.tab-code {
    font-size: 12px;
    opacity: 0.7;
    position: relative;
    z-index: 1;
}

.tab-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 82, 82, 0.2);
    color: var(--accent-red);
    font-size: 16px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.tab-btn:hover .tab-delete {
    opacity: 1;
}

.tab-delete:hover {
    background: var(--accent-red);
    color: white;
    transform: scale(1.1);
}


/* 指数信息 */
.index-info {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.index-name {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.index-price-group {
    display: flex;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 16px;
}

.index-price {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.index-change {
    display: flex;
    gap: 12px;
    font-size: 20px;
}

.change-value,
.change-percent {
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
}

.change-value.up,
.change-percent.up {
    color: var(--accent-red);
    background: rgba(255, 82, 82, 0.1);
}

.change-value.down,
.change-percent.down {
    color: var(--accent-green);
    background: rgba(76, 175, 80, 0.1);
}

.money-flow-info {
    font-size: 16px;
    color: var(--text-secondary);
}

.money-flow-info .label {
    margin-right: 8px;
}

.money-flow-info .value {
    font-weight: 600;
    font-size: 18px;
}

.money-flow-info .value.positive {
    color: var(--accent-red);
}

.money-flow-info .value.negative {
    color: var(--accent-green);
}

/* 图表容器 */
.chart-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

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

.legend {
    display: flex;
    gap: 24px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.legend-color {
    width: 32px;
    height: 4px;
    border-radius: 2px;
}

.chart {
    width: 100%;
    height: 500px;
}

/* 周期选择器 */
.chart-period-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.period-group {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.period-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.period-btn:hover {
    border-color: rgba(74, 158, 255, 0.3);
    background: rgba(74, 158, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.period-btn.active {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

/* 指标选择器 */
.chart-indicator-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.indicator-group {
    display: flex;
    gap: 8px;
    background: rgba(157, 78, 221, 0.05);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(157, 78, 221, 0.15);
}

.indicator-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.indicator-btn:hover:not(:disabled) {
    border-color: rgba(157, 78, 221, 0.3);
    background: rgba(157, 78, 221, 0.1);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.indicator-btn.active {
    background: linear-gradient(135deg, var(--accent-purple), #C77DFF);
    color: white;
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(157, 78, 221, 0.4);
}

.indicator-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* EMA参数配置样式 */
.ema-params-config {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

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

.ema-param-row label {
    min-width: 90px;
    font-size: 14px;
    color: var(--text-secondary);
}

.setting-input-small {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    max-width: 150px;
}

.setting-input-small:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: rgba(157, 78, 221, 0.1);
}

.setting-input-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 均线切换复选框样式 */
.indicator-with-options {
    position: relative;
    display: flex;
    align-items: center;
}

.ma-toggle-label {
    display: flex;
    align-items: center;
    margin-left: 5px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.ma-toggle-label:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.ma-toggle-label input {
    margin-right: 3px;
    cursor: pointer;
}

.ma-toggle-text {
    font-size: 11px;
    color: #9fa8da;
}

.ma-toggle-label input:checked+.ma-toggle-text {
    color: #4A9EFF;
    font-weight: bold;
}


/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 18px;
    color: var(--text-secondary);
}

/* 错误消息 */
.error-message {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 82, 82, 0.95);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(255, 82, 82, 0.4);
    z-index: 2000;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.error-icon {
    font-size: 24px;
}

.error-text {
    font-size: 16px;
}


/* 主力起势雷达相关样式 */
.indicator-with-info {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.info-icon-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #9fa8da;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.info-icon-btn:hover {
    background: rgba(74, 158, 255, 0.2);
    color: #4A9EFF;
    border-color: #4A9EFF;
}

/* 说明模态框样式 */
.instruction-content {
    padding: 10px;
    color: #e8e4f6;
}

.instruction-section {
    margin-bottom: 20px;
}

.instruction-section h4 {
    color: #4A9EFF;
    margin-bottom: 10px;
    font-size: 16px;
    border-left: 3px solid #4A9EFF;
    padding-left: 10px;
}

.instruction-list {
    list-style: none;
    padding: 0;
}

.instruction-list li {
    margin-bottom: 15px;
    position: relative;
    padding-left: 20px;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.legend-dot.purple {
    background-color: #D500F9;
}

.legend-dot.red {
    background-color: #FF1744;
}

.legend-dot.blue {
    background-color: #2979FF;
}

.highlight-box {
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid rgba(74, 158, 255, 0.3);
    padding: 15px;
    border-radius: 8px;
    line-height: 1.6;
}

.risk-list {
    color: #ffab91;
    font-size: 14px;
    line-height: 1.6;
}

.risk-list li {
    margin-bottom: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tabs {
        grid-template-columns: repeat(2, 1fr);
    }

    .index-price {
        font-size: 36px;
    }

    .index-change {
        font-size: 16px;
    }

    .chart {
        height: 400px;
    }

    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .tabs {
        grid-template-columns: 1fr;
    }

    /* Watchlist Page Styles */
    .nav-btn {
        color: var(--text-secondary);
        text-decoration: none;
        padding: 8px 16px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        transition: all 0.3s ease;
    }

    .nav-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        border-color: var(--accent-blue);
    }

    .watchlist-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
        gap: 20px;
        margin-bottom: 30px;
    }

    .stock-card {
        background: var(--bg-card);
        border-radius: 12px;
        border: 1px solid var(--border-color);
        padding: 16px;
        box-shadow: var(--shadow);
    }

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

    .stock-info {
        display: flex;
        flex-direction: column;
    }

    .stock-name {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .stock-code {
        font-size: 12px;
        color: var(--text-secondary);
    }

    .stock-price-info {
        text-align: right;
    }

    .stock-price-info .price {
        font-size: 20px;
        font-weight: 700;
        display: block;
    }

    .stock-price-info .change {
        font-size: 14px;
        font-weight: 600;
    }

    .stock-price-info .up {
        color: var(--accent-red);
    }

    .stock-price-info .down {
        color: var(--accent-green);
    }

    .mini-chart {
        width: 100%;
        height: 200px;
    }

    .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 60px;
        background: var(--bg-card);
        border-radius: 16px;
        border: 1px solid var(--border-color);
    }

    .empty-icon {
        font-size: 64px;
        margin-bottom: 20px;
    }

    .empty-text {
        font-size: 18px;
        color: var(--text-secondary);
        margin-bottom: 24px;
    }

    .btn-primary {
        background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
        color: white;
        padding: 10px 24px;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        transition: transform 0.2s;
    }

    .btn-primary:hover {
        transform: translateY(-2px);
    }

    @media (max-width: 768px) {
        .watchlist-grid {
            grid-template-columns: 1fr;
        }
    }

    .chart {
        height: 300px;
    }
}

/* Header Layout */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Search Bar */
.search-container {
    position: relative;
    width: 320px;
    /* 增加宽度 */
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
    filter: drop-shadow(0 0 4px rgba(74, 158, 255, 0.3));
}

#stockSearch {
    width: 100%;
    padding: 12px 16px 12px 45px;
    /* 增加高度和左边距为图标留空间 */
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#stockSearch:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.6);
    box-shadow: 0 0 0 4px rgba(74, 158, 255, 0.1), 0 4px 12px rgba(74, 158, 255, 0.3);
    transform: translateY(-1px);
}

.search-container:focus-within .search-icon {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(74, 158, 255, 0.6));
}

#stockSearch::placeholder {
    color: rgba(159, 168, 218, 0.6);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a2140;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.search-item .code {
    color: #9fa8da;
    font-size: 12px;
}

.search-item .name {
    color: #fff;
    font-size: 14px;
}

/* Settings Button */
.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9fa8da;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    position: relative;
    overflow: hidden;
}

.icon-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(74, 158, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.5);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.icon-btn:hover::before {
    width: 100%;
    height: 100%;
}

.icon-btn:active {
    transform: translateY(0);
}

/* 特殊样式：自选股按钮 */
#watchlistBtn {
    font-size: 22px;
}

#watchlistBtn:hover {
    animation: starPulse 0.6s ease-in-out;
}

@keyframes starPulse {

    0%,
    100% {
        transform: translateY(-2px) scale(1);
    }

    50% {
        transform: translateY(-2px) scale(1.15);
    }
}

/* 特殊样式：返回首页按钮 */
#homeBtn {
    font-size: 22px;
}

#homeBtn:hover {
    animation: homeShake 0.5s ease-in-out;
}

@keyframes homeShake {

    0%,
    100% {
        transform: translateY(-2px) rotate(0deg);
    }

    25% {
        transform: translateY(-2px) rotate(-10deg);
    }

    75% {
        transform: translateY(-2px) rotate(10deg);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-card);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    transform: scale(0.95);
    animation: scaleUp 0.3s forwards;
}

@keyframes scaleUp {
    to {
        transform: scale(1);
    }
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.05), rgba(157, 78, 221, 0.05));
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(74, 158, 255, 0.3));
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 82, 82, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Modal container for larger modals */
.modal-container {
    background: var(--bg-card);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    animation: scaleUp 0.3s forwards;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.02), rgba(157, 78, 221, 0.02));
    flex-shrink: 0;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}


.setting-item {
    margin-bottom: 24px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.label-icon {
    font-size: 16px;
}

.setting-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.setting-item select,
.setting-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
    appearance: none;
    /* Remove default arrow for select */
}

.setting-item select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239fa8da' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
}

.setting-item select:focus,
.setting-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.watchlist-add-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.watchlist-search-container {
    position: relative;
}

.watchlist-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.watchlist-search-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.watchlist-search-item:last-child {
    border-bottom: none;
}

.watchlist-search-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.watchlist-search-item .name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.watchlist-search-item .code {
    color: var(--text-secondary);
    font-size: 12px;
}

.watchlist-search-item.added {
    background: rgba(74, 158, 255, 0.1);
    cursor: default;
}

.watchlist-search-item.added .name {
    color: var(--accent-blue);
}

.watchlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.watchlist-count {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.count-icon {
    font-size: 18px;
}

.watchlist-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.watchlist-manager {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
}

.watchlist-manager-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.watchlist-manager-item:last-child {
    border-bottom: none;
}

.watchlist-manager-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.delete-btn {
    color: var(--accent-red);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.delete-btn:hover {
    background: rgba(255, 82, 82, 0.1);
}

/* Settings Modal Tabs */
.settings-tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 6px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.settings-tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.settings-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.settings-tab-btn:hover .tab-icon {
    transform: scale(1.1);
}

.settings-tab-btn.active {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.settings-tab-btn.active .tab-icon {
    transform: scale(1.15);
}

.settings-content {
    display: none;
    animation: fadeInContent 0.3s ease;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-content.active {
    display: block;
}

.setting-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-icon {
    font-size: 16px;
    margin-right: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.5);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.2);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Watchlist Bar */
.watchlist-bar {
    display: grid;
    grid-template-columns: repeat(var(--watchlist-columns, 8), 1fr);
    /* 限制一行显示数量，默认8 */
    gap: 10px;
    margin-bottom: 20px;
}

.watchlist-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.3s ease;
}

.watchlist-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.3);
}

.watchlist-item.active {
    background: rgba(74, 158, 255, 0.2);
    border-color: #4A9EFF;
}

.watchlist-item .name {
    color: #fff;
    font-size: 13px;
}

.watchlist-item .change {
    font-size: 12px;
    font-weight: bold;
}

.watchlist-item .change.up {
    color: #ff5252;
}

.watchlist-item .change.down {
    color: #00e676;
}

/* Watchlist Delete Button */
.watchlist-delete {
    color: var(--accent-red);
    cursor: pointer;
    font-size: 16px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 82, 82, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.watchlist-item:hover .watchlist-delete {
    opacity: 1;
}

.watchlist-delete:hover {
    background: var(--accent-red);
    color: white;
    transform: scale(1.1);
}

/* Add to Watchlist Button */
.add-watchlist-btn {
    margin-left: 10px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #9fa8da;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.add-watchlist-btn:hover {
    border-color: #4A9EFF;
    color: #4A9EFF;
}

.add-watchlist-btn.added {
    background: rgba(74, 158, 255, 0.2);
    border-color: #4A9EFF;
    color: #4A9EFF;
}

/* 注销按钮样式 */
.logout-btn {
    background: rgba(244, 67, 54, 0.1) !important;
    border-color: rgba(244, 67, 54, 0.3) !important;
    color: #ff5252 !important;
}

.logout-btn:hover {
    background: rgba(244, 67, 54, 0.25) !important;
    border-color: rgba(244, 67, 54, 0.6) !important;
}

.logout-btn:active {
    background: rgba(244, 67, 54, 0.35) !important;
}



/* 修改密码页面样式 */
.password-hint-box {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1), rgba(157, 78, 221, 0.1));
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.hint-icon {
    font-size: 40px;
    line-height: 1;
}

.hint-text {
    flex: 1;
}

.hint-text strong {
    color: var(--accent-blue);
    font-size: 16px;
    display: block;
    margin-bottom: 10px;
}

.hint-text p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 5px 0;
    line-height: 1.6;
}

.password-strength {
    margin-top: 8px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.password-strength::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength.weak::before {
    width: 33%;
    background: #f44336;
}

.password-strength.medium::before {
    width: 66%;
    background: #ff9800;
}

.password-strength.strong::before {
    width: 100%;
    background: #4caf50;
}

.password-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

.password-message.success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

.password-message.error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
    vertical-align: middle;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--accent-blue);
}

/* 导入导出功能区 */
.watchlist-import-export {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}

.import-export-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.section-icon {
    font-size: 20px;
}

.import-export-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.import-export-hint {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.8;
}

/* 导入模式对话框 */
.small-modal {
    max-width: 480px !important;
}

.import-mode-option {
    margin-bottom: 16px;
}

.import-mode-option:last-child {
    margin-bottom: 0;
}

.import-mode-btn {
    width: 100%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.import-mode-btn:hover {
    border-color: var(--accent-blue);
    background: rgba(74, 158, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.2);
}

.mode-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.mode-info {
    flex: 1;
    text-align: left;
}

.mode-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mode-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.mode-desc.warning {
    color: var(--accent-red);
}

/* 次要按钮样式 */
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.2);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .import-export-actions {
        grid-template-columns: 1fr;
    }

    .import-mode-btn {
        padding: 16px;
    }
}