/* 通达信选股公式提取 - 插件样式 */
/* 页面主体背景 同步目标站 #f3f5f7 */
body {
    background-color: #f3f5f7 !important;
}

/* ==================== 面包屑导航 ==================== */
.breadcrumb-box {
    max-width: 1300px;
    margin: 0 auto 0px auto;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 15px;
}
.breadcrumb-box a {
    color: #333;
    text-decoration: none;
}
.breadcrumb-box a:hover {
    color: #0066cc;
    text-decoration: underline;
}
.breadcrumb-box .split {
    margin: 0 8px;
    color: #888;
}
.breadcrumb-box .current {
    color: #666;
}

/* ==================== 主容器 ==================== */
.xg-wrapper {
    max-width: 1300px;
    margin: 0 auto 20px auto;
    padding: 0 15px;
}
.xg-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 30px 60px -15px rgba(0,20,40,0.3);
    padding: 32px;
}

/* ===== 关键：内部元素 reset，隔离 Discuz 全局样式 ===== */
.xg-card *,
.xg-card *::before,
.xg-card *::after {
    box-sizing: border-box;
}
.xg-card button,
.xg-card input,
.xg-card textarea {
    float: none !important;
    margin: 0 !important;
    vertical-align: middle !important;
    font-family: inherit !important;
    line-height: normal !important;
}
.xg-card button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ==================== 标题 ==================== */
.xg-card h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #0a1929;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.3;
}
.xg-card .sub {
    color: #2c3e50;
    font-size: 1rem;
    margin: 0 0 28px 0;
    border-left: 6px solid #2563eb;
    padding: 10px 22px;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    line-height: 1.7;
}
.xg-card .badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 15px;
    display: inline-block;
}

/* ==================== 控制行 ==================== */
.control-panel {
    display: flex !important;
    gap: 20px !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    margin-bottom: 20px !important;
}
.input-group {
    flex: 3;
    min-width: 240px;
    display: flex;
    flex-direction: column;
}
.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #475569;
    margin-bottom: 6px;
}
.input-group input {
    width: 100% !important;
    padding: 14px 18px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    background: #fff !important;
    transition: 0.15s;
    height: 54px !important;
    outline: none !important;
}
.input-group input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.15) !important;
}
.btn-group {
    display: flex !important;
    gap: 12px !important;
    align-items: flex-end !important;
}

/* ==================== 按钮 ==================== */
.xg-card button {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #fff !important;
    padding: 14px 28px !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
    box-shadow: 0 6px 12px -4px rgba(0,0,0,0.2) !important;
    height: 54px !important;
    white-space: nowrap !important;
    gap: 6px;
}
.xg-card button.primary {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
}
.xg-card button.primary:hover {
    background: #1d4ed8 !important;
}
.xg-card button:hover {
    background: #2d3a4f !important;
}
.xg-card button:active {
    transform: scale(0.96);
}

/* ==================== 代码面板（双栏） ==================== */
.code-panel {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
    margin: 24px 0 16px 0 !important;
    align-items: stretch !important;
}
.box {
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 12px -6px #d1d5db;
    display: flex !important;
    flex-direction: column !important;
}
.box h3 {
    font-size: 1.25rem;
    margin: 0 0 16px 0;
    color: #0f172a;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.box h3 span {
    background: #e2e8f0;
    color: #1e293b;
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 30px;
}
.xg-card textarea {
    width: 100% !important;
    height: 460px !important;
    padding: 20px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    background: #fafcfc !important;
    resize: vertical;
    white-space: pre;
    overflow-x: auto;
    outline: none !important;
    flex-shrink: 0;
}
.xg-card textarea:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.2) !important;
}

/* ==================== 右侧输出区 ==================== */
.box.output-box {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.output-container {
    background: #0f172a;
    border-radius: 12px;
    padding: 4px;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0;
}
.output-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 14px 22px 8px 22px;
    color: #a5b4cb;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
}
.output-header-left {
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
}
.output-header-left button {
    height: 38px !important;
    padding: 8px 18px !important;
    font-size: 0.85rem !important;
    background: #2d3a4f !important;
    border-color: #475569 !important;
    box-shadow: none !important;
}
.copy-btn {
    height: 38px !important;
    padding: 8px 20px !important;
    background: #2d3a4f !important;
    border: 1px solid #475569 !important;
    color: #b9c7dd !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    transition: 0.1s !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.copy-btn:hover {
    background: #3b4a62 !important;
    color: #fff !important;
}
.output-content {
    flex: 1 !important;
    padding: 0 22px 20px 22px;
    overflow: auto;
    min-height: 400px;
}
.output-content pre {
    margin: 0;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ==================== 依赖显示区 ==================== */
.depends-area {
    background: #1e2a3a;
    border-radius: 8px;
    margin: 8px 22px 16px 22px;
    padding: 14px 18px;
    color: #b0c4de;
    font-size: 0.85rem;
    max-height: 150px;
    overflow: auto;
    border: 1px solid #334155;
    display: none;
    flex-shrink: 0;
}
.depends-area.visible {
    display: block;
}
.depends-title {
    font-weight: 600;
    color: #a5b4cb;
    margin-bottom: 8px;
}
.depends-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.depends-tag {
    background: #2d3a4f;
    padding: 4px 14px;
    border-radius: 6px;
    color: #cbd5e1;
    font-family: monospace;
    border: 1px solid #475569;
}

/* ==================== 底部 ==================== */
.xg-footer {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed #cbd5e1;
    padding-top: 18px;
    color: #475569;
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 10px;
}
.stats {
    background: #e6f0ff;
    padding: 6px 20px;
    border-radius: 8px;
    color: #1e4b8f;
    font-weight: 500;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .code-panel {
        grid-template-columns: 1fr !important;
    }
    .xg-card {
        padding: 20px;
        border-radius: 12px;
    }
    .xg-card h1 {
        font-size: 1.5rem;
    }
    .control-panel {
        flex-direction: column;
        align-items: stretch !important;
    }
    .btn-group {
        justify-content: center;
    }
}
