* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    background: #1a1a2e;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #1a1a2e;
    min-height: 100vh;
    min-height: 100dvh;
    color: #fff;
    line-height: 1.6;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    overflow-x: hidden;
}

.container {
    max-width: 520px;
    margin: 0 auto;
    padding: 1.25rem;
    padding-top: max(1.25rem, env(safe-area-inset-top));
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 1.75rem;
    font-weight: 900;
    background: linear-gradient(90deg, #2ed573, #7bed9f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    font-weight: 600;
}

/* 卡片样式 - STEPN 风格 */
.card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-radius: 24px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ai-input-area {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.textarea-wrapper {
    position: relative;
}

.btn-clear {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
    pointer-events: none;
}

.btn-clear.show {
    opacity: 1;
    pointer-events: auto;
}

.btn-clear:hover {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.ai-textarea {
    width: 100%;
    height: 110px;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.9375rem;
    font-family: inherit;
    resize: none;
    transition: all 0.3s ease;
}

.ai-textarea:focus {
    outline: none;
    border-color: #2ed573;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(46, 213, 115, 0.15);
}

.ai-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.ai-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

/* STEPN 风格按钮 */
.btn-primary {
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #2ed573 0%, #26ab5f 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow:
        0 4px 16px rgba(46, 213, 115, 0.4),
        inset 0 -3px 0 rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 24px rgba(46, 213, 115, 0.5),
        inset 0 -3px 0 rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow:
        0 2px 8px rgba(46, 213, 115, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #ff9f43 0%, #ee8a2f 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow:
        0 4px 16px rgba(255, 159, 67, 0.4),
        inset 0 -3px 0 rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 24px rgba(255, 159, 67, 0.5),
        inset 0 -3px 0 rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary:active {
    transform: translateY(1px);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 结果区域 */
.result-section {
    margin-top: 1.25rem;
    display: none;
}

.result-section.show {
    display: block;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 信息项 - 圆润卡片式 */
.info-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    margin-bottom: 0.625rem;
    transition: all 0.2s ease;
}

.info-item:hover {
    background: rgba(0, 0, 0, 0.3);
}

.info-content {
    flex: 1;
    min-width: 0;
}

.info-label {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.125rem;
}

.info-value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #fff;
    word-break: break-all;
    cursor: pointer;
    padding: 0.25rem 0;
    border-radius: 6px;
    transition: background 0.2s;
}

.info-value:hover {
    background: rgba(255, 255, 255, 0.05);
}

.info-value.empty {
    color: rgba(255, 255, 255, 0.3);
}

/* 版本选择 */
.version-select {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: #fff;
    font-size: 0.9375rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0.25rem 1.5rem 0.25rem 0;
    border-radius: 6px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232ed573' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
}

.version-select:focus {
    outline: none;
}

.version-select option {
    background: #1a1a2e;
    color: #fff;
}

/* 生成按钮 - 大号 */
.generate-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 800;
    border-radius: 16px;
    margin-top: 0.5rem;
    justify-content: center;
    background: linear-gradient(135deg, #2ed573 0%, #20bf6b 100%);
    box-shadow:
        0 8px 24px rgba(46, 213, 115, 0.4),
        inset 0 -4px 0 rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.generate-btn:hover {
    box-shadow:
        0 12px 32px rgba(46, 213, 115, 0.5),
        inset 0 -4px 0 rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

/* 状态消息 */
.status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 14px;
    font-size: 0.875rem;
    font-weight: 600;
    display: none;
}

.status.success {
    display: block;
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.2) 0%, rgba(46, 213, 115, 0.1) 100%);
    border: 1px solid rgba(46, 213, 115, 0.3);
    color: #7bed9f;
}

.status.error {
    display: block;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2) 0%, rgba(255, 107, 107, 0.1) 100%);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.status.loading {
    display: block;
    background: linear-gradient(135deg, rgba(69, 170, 242, 0.2) 0%, rgba(69, 170, 242, 0.1) 100%);
    border: 1px solid rgba(69, 170, 242, 0.3);
    color: #74b9ff;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #ff9f43 0%, #ee8a2f 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow:
        0 4px 16px rgba(255, 159, 67, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.download-btn:hover {
    transform: translateY(-2px);
}

.download-btn:active {
    transform: translateY(1px);
}

/* 编辑弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #1a1a2e;
    border-radius: 24px;
    padding: 1.5rem;
    width: calc(100% - 2rem);
    max-width: 340px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.modal-overlay.show .modal-card {
    transform: scale(1);
}

.modal-card h3 {
    font-size: 1.125rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
}

.modal-card input {
    width: 100%;
    max-width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    margin-bottom: 1rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.modal-card input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    min-height: 3rem;
}

.modal-card input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.modal-card input:focus {
    outline: none;
    border-color: #2ed573;
    box-shadow: 0 0 0 4px rgba(46, 213, 115, 0.15);
}

.modal-btns {
    display: flex;
    gap: 0.75rem;
}

.modal-btns button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btns .cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.modal-btns .cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal-btns .save-btn {
    background: linear-gradient(135deg, #2ed573 0%, #26ab5f 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(46, 213, 115, 0.3);
}

.modal-btns .save-btn:hover {
    transform: translateY(-1px);
}

/* 登录弹窗 */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.auth-overlay.hidden {
    display: none;
}

.auth-card {
    background: #1a1a2e;
    border-radius: 28px;
    padding: 2rem 1.5rem;
    width: calc(100% - 2rem);
    max-width: 340px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.auth-card h2 {
    font-size: 1.375rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

.auth-card p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.auth-card input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 2px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.auth-card input:focus {
    outline: none;
    border-color: #a55eea;
    box-shadow: 0 0 0 4px rgba(165, 94, 234, 0.15);
}

.auth-card input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: normal;
}

.auth-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #a55eea 0%, #8854d0 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow:
        0 8px 24px rgba(165, 94, 234, 0.4),
        inset 0 -3px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 32px rgba(165, 94, 234, 0.5),
        inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-error {
    color: #ff6b6b;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 0.75rem;
    display: none;
}

.auth-error.show {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* 响应式 */
@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
    }

    .form-row .form-input {
        min-width: 100% !important;
    }

    .form-row .btn-add {
        width: 100%;
    }

    .modal-card {
        margin: 0.5rem;
        max-width: none;
        width: calc(100% - 1rem);
    }

    .auth-card {
        margin: 0.5rem;
        max-width: none;
        width: calc(100% - 1rem);
        padding: 1.5rem 1rem;
    }

    .account-stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 380px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 1rem;
    }

    .card {
        padding: 1rem;
        border-radius: 20px;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .account-card {
        padding: 0.875rem;
    }

    .stat-item {
        padding: 0.5rem 0.625rem;
    }

    .stat-value {
        font-size: 0.875rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Tab 导航 */
.tab-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.375rem;
    border-radius: 14px;
}

.tab-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, #2ed573 0%, #26ab5f 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(46, 213, 115, 0.3);
}

.tab-btn:not(.active):hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 账户管理 */
.account-section {
    margin-bottom: 1rem;
}

.add-account-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-row .form-input {
    flex: 1;
    min-width: 0;
}

.form-row:first-child .form-input {
    min-width: calc(50% - 0.25rem);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #2ed573;
    box-shadow: 0 0 0 3px rgba(46, 213, 115, 0.15);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.btn-add {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #a55eea 0%, #8854d0 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(165, 94, 234, 0.3);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(165, 94, 234, 0.4);
}

.btn-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 账户卡片列表 */
.account-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-radius: 20px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

/* 汇总面板 - 统计面板样式 */
.summary-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.875rem;
}

.summary-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-panel-title svg {
    opacity: 0.6;
}

.summary-panel-meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.summary-panel .summary-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.summary-refresh-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.summary-refresh-btn:hover {
    background: rgba(46, 213, 115, 0.15);
    color: #2ed573;
}

.summary-refresh-btn:active {
    transform: scale(0.95);
}

.summary-panel-stats {
    display: flex;
    gap: 0.5rem;
}

.summary-stat {
    flex: 1;
    text-align: center;
    padding: 0.625rem 0.375rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.summary-stat-value {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.125rem;
    font-variant-numeric: tabular-nums;
}

.summary-stat-value.positive {
    color: #ff4757;
}

.summary-stat-value.negative {
    color: #2ed573;
}

.summary-stat-label {
    font-size: 0.5625rem;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.account-card.loading {
    opacity: 0.7;
}

.account-card.error {
    border-color: rgba(255, 107, 107, 0.3);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.account-login {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.account-server {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.account-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.btn-icon.refresh:hover {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

.btn-icon.delete:hover {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.btn-icon.refresh.spinning svg {
    animation: spin 0.7s linear infinite;
}

.account-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.stat-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 0.625rem 0.75rem;
}

.stat-label {
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.125rem;
}

.stat-value {
    font-size: 0.9375rem;
    font-weight: 800;
    color: #fff;
}

.stat-value.positive {
    color: #ff4757;
}

.stat-value.negative {
    color: #2ed573;
}

.positions-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.positions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.positions-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    text-transform: uppercase;
}

.positions-count {
    font-size: 0.75rem;
    color: #2ed573;
    font-weight: 700;
}

.position-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.125rem 0.375rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    margin-bottom: 0.0625rem;
}

.position-item:last-child {
    margin-bottom: 0;
}

.position-info {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.position-type {
    font-size: 0.5625rem;
    font-weight: 800;
    padding: 0.0625rem 0.3rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.position-type.buy {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

.position-type.sell {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

.position-symbol {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.position-volume {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.5);
}

.position-profit {
    font-size: 0.8125rem;
    font-weight: 700;
}

.account-error {
    color: #ff6b6b;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: rgba(255, 255, 255, 0.4);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.875rem;
    font-weight: 600;
}

/* 汇总卡片特殊样式 */
.account-card.summary {
    margin-bottom: 1.5rem;
    border-width: 2px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.summary-title {
    font-size: 1rem;
    font-weight: 800;
    color: #2ed573;
}

.summary-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

/* 持仓详情弹窗 */
.positions-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1a2e;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.positions-modal.show {
    opacity: 1;
    visibility: visible;
}

.positions-modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    overflow: hidden;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}

.positions-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.positions-modal-title {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    display: inline;
}

.positions-modal-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    display: inline;
    margin-left: 0.5rem;
}

.positions-modal-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.positions-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.positions-modal-actions {
    display: flex;
    gap: 0.5rem;
}

/* 账户信息栏 */
.positions-modal-account {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 0.7rem;
}

.positions-modal-account-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.positions-modal-account-label {
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.positions-modal-account-value {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.positions-modal-account-value.positive {
    color: #ff4757;
}

.positions-modal-account-value.negative {
    color: #2ed573;
}

/* WebSocket 连接状态 */
.ws-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.ws-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

.ws-status.connected .ws-dot {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.ws-status.connecting .ws-dot {
    background: #facc15;
    animation: pulse 1s ease-in-out infinite;
}

.ws-status.disconnected .ws-dot {
    background: #f87171;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.positions-modal-list {
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.positions-modal-list .position-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.125rem 1rem;
    margin-bottom: 0.375rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.positions-modal-list .position-item:last-child {
    margin-bottom: 0;
}

.positions-modal-list .position-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.positions-modal-list .position-symbol {
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
}

.positions-modal-list .position-volume {
    font-size: 0.75rem;
    white-space: nowrap;
}

.positions-modal-list .position-profit {
    font-size: 0.9375rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.positions-modal-list .position-profit.positive {
    color: #ff4757;
}

.positions-modal-list .position-profit.negative {
    color: #2ed573;
}

.positions-modal-list .position-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.positions-modal-list .position-price {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.positions-modal-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

/* 持仓分组标题 */
.position-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.375rem;
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border-left: 3px solid #6c5ce7;
}

.position-group-header:first-child {
    margin-top: 0;
}

.position-group-magic {
    font-size: 0.75rem;
    font-weight: 700;
    color: #a29bfe;
}

.position-group-stats {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.position-group-profit {
    font-size: 0.8125rem;
    font-weight: 700;
}

.position-group-profit.positive {
    color: #ff4757;
}

.position-group-profit.negative {
    color: #2ed573;
}

.position-group-close-btn {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.position-group-close-btn:hover {
    background: rgba(255, 71, 87, 0.4);
}

/* 魔术号Tab */
.magic-tabs {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
}

.magic-tabs::-webkit-scrollbar {
    display: none;
}

.magic-tab {
    padding: 0.25rem 0.625rem;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.magic-tab.active {
    background: rgba(108, 92, 231, 0.3);
    color: #d0c9ff;
    border: 1px solid rgba(108, 92, 231, 0.5);
}

.magic-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 持仓汇总 */
.positions-summary {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.375rem 0.75rem;
    margin-top: 0.375rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    flex-shrink: 0;
}

.positions-summary-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.375rem;
}

.positions-summary-label {
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.positions-summary-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.positions-summary-value.positive {
    color: #ff4757;
}

.positions-summary-value.negative {
    color: #2ed573;
}

.positions-summary-value.buy {
    color: #ef5350;
}

.positions-summary-value.sell {
    color: #26a69a;
}

/* B/S 标签颜色 */
.label-buy {
    color: #ef5350;
    font-weight: 700;
}

.label-sell {
    color: #26a69a;
    font-weight: 700;
}

/* 分组总收益 */
.summary-total {
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* 计算器按钮 */
.calc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.calc-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* 计算器弹窗 */
.calc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.calc-modal.show {
    opacity: 1;
    visibility: visible;
}

.calc-modal-content {
    background: linear-gradient(145deg, #252542, #1a1a2e);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    width: 90%;
    max-width: 300px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.calc-modal-content h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    text-align: center;
}

.calc-form-group {
    margin-bottom: 0.5rem;
}

.calc-form-label {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.calc-form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    text-align: center;
    box-sizing: border-box;
}

.calc-form-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.calc-results {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.calc-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.calc-result-item:last-child {
    border-bottom: none;
}

.calc-result-item.total {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.15rem;
    padding-top: 0.4rem;
}

.calc-result-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.calc-result-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.calc-result-value.positive {
    color: #ff4757;
}

.calc-result-value.negative {
    color: #2ed573;
}

.calc-close-btn {
    width: 100%;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.calc-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* K线图表区域 */
.chart-section {
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.chart-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.timeframe-tabs {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.25rem;
}

.tf-btn {
    padding: 0.375rem 0.625rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.tf-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.tf-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.chart-indicators {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.indicator-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
}

.chart-container {
    width: 100%;
    height: 280px;
    background: #131722;
    border-radius: 10px;
    overflow: hidden;
}

/* 当前价格显示 */
.positions-modal-prices {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.positions-modal-prices .price-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.positions-modal-prices .price-label {
    font-size: 0.5625rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.positions-modal-prices .price-value {
    font-size: 0.875rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.positions-modal-prices .price-value.buy {
    color: #ff4757;
}

.positions-modal-prices .price-value.sell {
    color: #2ed573;
}

.positions-modal-prices .price-divider {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
}

/* 交易操作按钮区域 */
.trade-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.trade-btn {
    flex: 1;
    padding: 0.125rem 0.5rem;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.trade-btn.buy {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.2) 0%, rgba(255, 71, 87, 0.1) 100%);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.trade-btn.buy:hover {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.3) 0%, rgba(255, 71, 87, 0.2) 100%);
}

.trade-btn.sell {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.2) 0%, rgba(46, 213, 115, 0.1) 100%);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.trade-btn.sell:hover {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.3) 0%, rgba(46, 213, 115, 0.2) 100%);
}

.trade-btn.close-all {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.2) 0%, rgba(255, 159, 67, 0.1) 100%);
    color: #ff9f43;
    border: 1px solid rgba(255, 159, 67, 0.3);
}

.trade-btn.close-all:hover {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.3) 0%, rgba(255, 159, 67, 0.2) 100%);
}

.trade-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 单个持仓平仓按钮 */
.position-close-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 107, 107, 0.15);
    color: rgba(255, 107, 107, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.position-close-btn:hover {
    background: rgba(255, 107, 107, 0.25);
    color: #ff6b6b;
}

.position-close-btn:active {
    transform: scale(0.9);
}

.position-close-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 下单弹窗 */
.order-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.order-modal.show {
    opacity: 1;
    visibility: visible;
}

.order-modal-content {
    background: #1a1a2e;
    border-radius: 24px;
    padding: 1.5rem;
    width: calc(100% - 2rem);
    max-width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.order-modal.show .order-modal-content {
    transform: scale(1);
}

.order-modal h3 {
    font-size: 1.125rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    text-align: center;
}

.order-modal h3.buy {
    color: #ff4757;
}

.order-modal h3.sell {
    color: #2ed573;
}

.order-form-group {
    margin-bottom: 1rem;
}

.order-form-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
}

.order-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1.125rem;
    font-family: inherit;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.2s;
}

.order-form-input:focus {
    outline: none;
    border-color: #2ed573;
    box-shadow: 0 0 0 3px rgba(46, 213, 115, 0.15);
}

.lot-presets {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.lot-preset-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.lot-preset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.lot-preset-btn.active {
    background: rgba(46, 213, 115, 0.2);
    border-color: rgba(46, 213, 115, 0.3);
    color: #2ed573;
}

.order-modal .modal-btns {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.order-modal .cancel-btn {
    flex: 1;
    padding: 0.875rem;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.order-modal .cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.order-modal .confirm-btn {
    flex: 1;
    padding: 0.875rem;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.order-modal .confirm-btn.buy {
    background: linear-gradient(135deg, #ff4757 0%, #ee3a4a 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

.order-modal .confirm-btn.sell {
    background: linear-gradient(135deg, #2ed573 0%, #26ab5f 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(46, 213, 115, 0.3);
}

.order-modal .confirm-btn:hover {
    transform: translateY(-1px);
}

.order-modal .confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 添加账户弹窗 */
.add-account-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.add-account-modal.show {
    opacity: 1;
    visibility: visible;
}

.add-account-modal-content {
    background: #1a1a2e;
    border-radius: 24px;
    padding: 1.5rem;
    width: calc(100% - 2rem);
    max-width: 340px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.add-account-modal.show .add-account-modal-content {
    transform: scale(1);
}

.add-account-modal h3 {
    font-size: 1.125rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    text-align: center;
}

.add-account-modal .form-input {
    margin-bottom: 0.75rem;
}

.add-account-modal .modal-btns {
    margin-top: 0.5rem;
}

/* 确认弹窗 */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirm-modal.show {
    opacity: 1;
    visibility: visible;
}

.confirm-modal-content {
    background: #1a1a2e;
    border-radius: 24px;
    padding: 1.5rem;
    width: calc(100% - 2rem);
    max-width: 300px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    text-align: center;
}

.confirm-modal.show .confirm-modal-content {
    transform: scale(1);
}

.confirm-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 107, 107, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.confirm-modal-icon svg {
    color: #ff6b6b;
}

.confirm-modal h3 {
    font-size: 1.125rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

.confirm-modal p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.confirm-modal .modal-btns {
    display: flex;
    gap: 0.75rem;
}

.confirm-modal .cancel-btn,
.confirm-modal .delete-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-modal .cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.confirm-modal .cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.confirm-modal .delete-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    border: none;
    color: #fff;
}

.confirm-modal .delete-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.confirm-modal .close-trade-btn {
    background: linear-gradient(135deg, #ff9f43 0%, #ee8a30 100%);
    border: none;
    color: #fff;
}

.confirm-modal .close-trade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 159, 67, 0.4);
}

.confirm-modal-icon.close-trade {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.2) 0%, rgba(238, 138, 48, 0.1) 100%);
    color: #ff9f43;
}

/* 添加账户按钮 */
.btn-add-trigger {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(165, 94, 234, 0.2) 0%, rgba(165, 94, 234, 0.1) 100%);
    border: 2px dashed rgba(165, 94, 234, 0.4);
    border-radius: 16px;
    color: #a55eea;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.btn-add-trigger:hover {
    background: linear-gradient(135deg, rgba(165, 94, 234, 0.3) 0%, rgba(165, 94, 234, 0.15) 100%);
    border-color: rgba(165, 94, 234, 0.6);
}

/* 账户卡片可点击 */
.account-card.clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.account-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.account-card.clickable:active {
    transform: translateY(0);
}

/* 持仓提示 */
.positions-hint {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-weight: 600;
}

.positions-hint-icon {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 编辑持仓弹窗 */
.edit-position-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1003;
    padding: 1rem;
}

.edit-position-modal.show {
    display: flex;
}

.edit-position-modal-content {
    background: #1a1a2e;
    border-radius: 24px;
    padding: 1.5rem;
    width: calc(100% - 2rem);
    max-width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.edit-position-modal h3 {
    font-size: 1.125rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    text-align: center;
}

.edit-position-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.edit-position-info-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.edit-position-type {
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
}

.edit-position-type.buy {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

.edit-position-type.sell {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

.edit-position-symbol {
    font-weight: 700;
    color: #fff;
}

.edit-position-volume {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

.edit-position-form {
    margin-bottom: 1rem;
}

.edit-form-group {
    margin-bottom: 0.75rem;
}

.edit-form-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
}

.edit-input-row {
    display: flex;
    gap: 0.5rem;
}

.edit-form-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.2s;
}

.edit-form-input:focus {
    outline: none;
    border-color: #2ed573;
    box-shadow: 0 0 0 3px rgba(46, 213, 115, 0.15);
}

.edit-form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.edit-clear-btn {
    width: 44px;
    height: 44px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-clear-btn:hover {
    background: rgba(255, 71, 87, 0.2);
    border-color: rgba(255, 71, 87, 0.3);
}

.edit-clear-btn:active {
    transform: scale(0.95);
}

/* 持仓列表按钮容器 */
.positions-modal-list .position-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* 持仓 TP/SL 显示 */
.positions-modal-list .position-tpsl {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 0.25rem;
    gap: 1px;
}

.positions-modal-list .tpsl-line {
    font-size: 0.5625rem;
    line-height: 1.2;
    white-space: nowrap;
}

.positions-modal-list .tpsl-line.tp {
    color: #ff6b6b;
}

.positions-modal-list .tpsl-line.sl {
    color: #2ed573;
}

/* 持仓列表编辑按钮 */
.positions-modal-list .position-edit-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.positions-modal-list .position-edit-btn:hover {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

.positions-modal-list .position-edit-btn:active {
    transform: scale(0.9);
}
