/* 工具类 */
@layer utilities {
    /* 内容可见性优化 */
    .content-auto { content-visibility: auto; }

    /* 卡片阴影 */
    .card-shadow { box-shadow: 0 4px 12px rgba(18, 27, 41, 0.08); }
    .card-shadow-hover { box-shadow: 0 8px 24px rgba(91, 95, 239, 0.15); }

    /* 渐变效果 — subtle same-hue washes only */
    .gradient-bg { background: linear-gradient(135deg, rgba(91, 95, 239, 0.05), rgba(22, 163, 155, 0.05)); }
    .gradient-text { background: linear-gradient(135deg, #5b5fef, #16a39b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
    .gradient-border { border-image: linear-gradient(135deg, #5b5fef, #16a39b) 1; }

    /* 触摸友好 */
    .touch-friendly { min-height: 48px; min-width: 48px; touch-action: manipulation; }

    /* 移动端适配 */
    .mobile-input { font-size: 16px; }
    .mobile-button { min-height: 56px; font-size: 16px; }

    /* 表单布局 */
    .form-row-cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
    .form-row-cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }

    /* 表单元素 */
    .form-field { display: flex; flex-direction: column; }
    .form-label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 0.95rem; font-weight: 500; color: var(--neutral-800); }

    /* 表单提示 */
    .form-hint { font-size: 0.8rem; color: var(--neutral-500); margin-top: 6px; display: flex; align-items: flex-start; gap: 6px; }
    .form-hint-info { color: var(--primary); background: var(--primary-lighter); padding: 8px 10px; border-radius: 6px; border-left: 3px solid var(--primary); }
    .form-hint-warning { color: var(--warning); background: rgba(247, 127, 0, 0.1); padding: 8px 10px; border-radius: 6px; border-left: 3px solid var(--warning); }

    /* 输入框前缀 */
    .input-with-prefix { position: relative; }
    .input-prefix { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--neutral-500); font-weight: 600; font-size: var(--text-base); pointer-events: none; z-index: 1; }

    /* 定价 SOP：flex 左列固定最窄宽度，避免 CHF/€ 与数字叠字 */
    .pricing-field-prefix { min-width: 3.25rem; }
    @media (min-width: 640px) {
        .pricing-field-prefix { min-width: 4.25rem; }
    }

    /* 组合框下方说明区统一占位高度，两列表单项底部对齐 */
    .pricing-field-hint {
        min-height: 2.875rem;
    }

    /* 按钮样式 */
    .button { padding: 14px 20px; border: none; border-radius: var(--radius-lg); font-size: var(--text-base); font-weight: 600; cursor: pointer; transition: all var(--transition-normal); display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; white-space: nowrap; position: relative; overflow: hidden; }
    .button::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 var(--transition-slow); }
    .button:hover::before { left: 100%; }

    /* 按钮变体 */
    .button-primary { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(91, 95, 239, 0.28); }
    .button-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 16px rgba(91, 95, 239, 0.36); background: var(--primary-dark); }
    .button-secondary { background: var(--neutral-200); color: var(--neutral-700); box-shadow: var(--shadow-sm); }
    .button-secondary:hover:not(:disabled) { background: var(--neutral-300); transform: translateY(-1px); box-shadow: var(--shadow-md); }
    .button-accent { background: var(--accent); color: white; box-shadow: 0 4px 12px rgba(22, 163, 155, 0.28); }
    .button-accent:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 16px rgba(22, 163, 155, 0.36); }

    /* 按钮尺寸 */
    .button-large { padding: 16px 24px; font-size: var(--text-lg); min-height: 56px; }
    .button-small { padding: 10px 16px; font-size: var(--text-sm); min-height: 40px; }

    /* 按钮状态 */
    .button:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

    /* 加载状态 */
    .loading-state { display: none; text-align: center; padding: 40px; background: var(--neutral-50); border-radius: 16px; margin-top: 24px; }
    .loading-state.active { display: block; animation: fadeIn 0.3s ease; }

    /* 提示卡片 */
    .tips-card { background: linear-gradient(135deg, var(--accent-light) 0%, rgba(0, 168, 120, 0.05) 100%); border: 1.5px solid var(--accent); border-radius: 14px; padding: 24px; margin-top: 32px; }
    .tips-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 1.1rem; font-weight: 600; color: var(--neutral-800); }
    .tips-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
    .tips-item { display: flex; align-items: flex-start; gap: 10px; font-size: 0.95rem; color: var(--neutral-700); line-height: 1.5; }

    /* 模态框 */
    .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 1000; animation: fadeIn 0.3s ease; }
    .modal-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; border-radius: 12px; width: 90%; max-width: 1000px; max-height: 90vh; overflow: hidden; box-shadow: var(--shadow-xl); }
    .modal-header { background: var(--primary); color: white; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; }
    .modal-body { padding: 24px; max-height: 70vh; overflow-y: auto; }
    .modal-footer { padding: 16px 24px; border-top: 1px solid var(--neutral-200); display: flex; justify-content: flex-end; gap: 12px; }

    /* 表单 section */
    .form-section { margin-bottom: 40px; }
    .section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--neutral-200); }
    .section-number { width: 32px; height: 32px; background: var(--primary); color: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
    .section-badge { display: inline-block; background: var(--accent-light); color: var(--accent); padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

    /* 按钮组 */
    .button-group { display: grid; gap: 16px; margin-top: 32px; }

    /* 表单标记 */
    .required { color: var(--danger); font-weight: 700; }
    .optional { font-size: 0.8rem; color: var(--neutral-500); font-weight: 400; }
}

/* ================================ */
/* 模块二：全局变量和基础样式 */
/* ================================ */

/* 全局变量 — Trudave Ink + Signal */
:root {
    /* 主色调 · indigo signal */
    --primary: #5b5fef;
    --primary-light: #7d83fb;
    --primary-lighter: #eef0ff;
    --primary-dark: #4a45db;
    
    /* 强调色 · teal data + amber secondary */
    --accent: #16a39b;
    --accent-light: #cdefee;
    --accent-dark: #0f756f;
    
    /* 功能色 */
    --danger: #e5484d;
    --danger-light: #fcdcdd;
    --warning: #e0871a;
    --warning-light: #fdecc4;
    --success: #1fa971;
    --success-light: #d4f3e3;
    
    /* 中性色 · slate ramp */
    --neutral-900: #151b26;
    --neutral-800: #232c3a;
    --neutral-700: #364153;
    --neutral-600: #4d586a;
    --neutral-500: #6a7686;
    --neutral-400: #97a3b4;
    --neutral-300: #c4cdd9;
    --neutral-200: #dde3ec;
    --neutral-100: #eceff4;
    --neutral-50: #f4f6f9;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.15);
    --shadow-xl: 0 20px 25px rgba(15, 23, 42, 0.2);
    
    /* 间距 */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* 字体大小 */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    
    /* 过渡动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

}

/* 全局样式 */
html {
    /* Firefox：主滚动条配色 */
    scrollbar-width: auto;
    scrollbar-color: rgba(15, 90, 139, 0.45) rgba(241, 245, 249, 0.95);
}

/*
 * 视口右侧主滚动条（Chrome / Edge / Safari）
 * 默认系统滚动条过细难辨认，此处略加宽并圆角配色。
 */
html::-webkit-scrollbar {
    width: 11px;
}

html::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.9);
    border-radius: 999px;
}

html::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(25, 117, 176, 0.85), rgba(15, 90, 139, 0.92));
    border-radius: 999px;
    border: 2px solid rgba(241, 245, 249, 0.95);
    min-height: 48px;
}

html::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #1975b0, #0f5a8b);
}

body {
    font-family: 'Plus Jakarta Sans', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', '微软雅黑', system-ui, sans-serif;
    color: var(--neutral-700);
    background: #0c1017;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-body {
    position: relative;
    background: transparent;
    color: inherit;
}

.app-shell-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(0, 168, 120, 0.08), transparent 28%),
        radial-gradient(circle at left center, rgba(15, 90, 139, 0.1), transparent 32%);
    pointer-events: none;
    z-index: 0;
}

.app-shell {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

.app-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    z-index: 20;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 88vw);
    padding: 20px 18px;
    transform: translateX(-110%);
    transition: transform var(--transition-normal);
    z-index: 30;
}

.sidebar-open .app-sidebar {
    transform: translateX(0);
}

.sidebar-open .app-overlay {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 14px 18px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 12px 40px rgba(15, 23, 42, 0.08);
}

.brand-panel {
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(145deg, #0c4d76 0%, #0f5a8b 48%, #0a7c8f 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(15, 90, 139, 0.22);
}

.brand-panel h1 {
    margin-top: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.35;
}

.brand-panel p {
    margin-top: 6px;
    font-size: 0.75rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.82);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brand-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.16);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    color: var(--neutral-700);
    text-decoration: none;
    transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
    border: 1px solid transparent;
}

.sidebar-link:hover {
    background: var(--neutral-100);
    color: var(--primary);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(15, 90, 139, 0.12) 0%, rgba(0, 168, 120, 0.06) 100%);
    color: var(--primary);
    border-color: rgba(15, 90, 139, 0.14);
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-link-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--neutral-100);
    color: var(--primary);
    font-size: 0.95rem;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sidebar-link:hover .sidebar-link-icon {
    background: rgba(15, 90, 139, 0.12);
}

.sidebar-link.active .sidebar-link-icon {
    background: rgba(15, 90, 139, 0.18);
    color: var(--primary-dark);
}

.sidebar-link-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link-copy strong {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.sidebar-link-copy small {
    font-size: 0.72rem;
    color: var(--neutral-500);
    font-weight: 500;
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
}

.sidebar-footer p {
    font-weight: 700;
    color: var(--neutral-800);
}

.sidebar-footer span {
    display: block;
    margin-top: 4px;
    font-size: 0.84rem;
    color: var(--neutral-500);
}

.app-main {
    flex: 1;
    min-width: 0;
    padding: 18px;
}

/* 小屏：无顶部栏时，左上角浮动打开侧栏（大屏见下方 media 隐藏） */
.topbar-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary);
    font-size: 1.05rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 25;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.topbar-menu-button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 1);
    box-shadow: var(--shadow-lg);
}

.page-wrap {
    padding-top: 12px;
}

.page-hero {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: 20px;
    background:
        linear-gradient(140deg, rgba(15, 90, 139, 0.98), rgba(0, 168, 120, 0.86)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
    color: white;
    box-shadow: 0 14px 36px rgba(15, 90, 139, 0.18);
}

.page-kicker {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.page-hero h3 {
    margin-top: 6px;
    font-size: clamp(1.2rem, 2.6vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.page-description {
    margin-top: 8px;
    max-width: 56rem;
    font-size: 0.875rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
}

.page-hero-card {
    align-self: stretch;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
}

.page-hero-card p {
    margin-top: 6px;
    font-size: 0.82rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
}

.page-hero-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: none;
}

.page-content {
    animation: fadeIn 0.45s ease-in-out;
}

/* 亚马逊广告 · 关键词词库：单元格内垂直 + 水平居中（表格组件兜底） */
.kw-lib-table th,
.kw-lib-table td {
    vertical-align: middle;
    text-align: center;
}

/*
 * 定价 SOP（大屏）：上方双栏限制高度并在卡片内滚动；下方「生成历史」随 wt-content 整体下滚可见。
 */
@media (min-width: 1024px) {
    .wt-app:has(.pricing-sop-page) {
        min-height: 100svh;
    }

    .wt-main:has(.pricing-sop-page) {
        flex: 1;
        min-width: 0;
        min-height: 0;
        max-height: 100svh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .wt-main:has(.pricing-sop-page) .wt-page-hero {
        flex-shrink: 0;
    }

    .wt-main:has(.pricing-sop-page) .wt-content {
        flex: 1;
        min-height: 0;
        display: block;
        padding-top: 12px;
        padding-bottom: 32px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .pricing-sop-page {
        min-height: min-content;
    }

    .pricing-sop-page .pricing-sop-main.pricing-sop-layout {
        flex: 0 0 auto;
        min-height: 0;
        max-height: none;
        align-items: stretch;
        overflow: visible;
    }

    .pricing-sop-page .pricing-sop-main.pricing-sop-layout {
        align-items: stretch;
    }

    .pricing-sop-page .pricing-sop-panel-col {
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: auto;
        align-self: stretch;
    }

    .pricing-sop-page .pricing-sop-panel-card {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 480px;
        height: 100%;
        max-height: min(78vh, 920px);
        overflow: hidden;
    }

    .pricing-sop-page .pricing-sop-history-section {
        flex-shrink: 0;
        scroll-margin-top: 12px;
    }
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
}

.toast {
    min-width: min(360px, calc(100vw - 36px));
    max-width: 420px;
    padding: 14px 16px;
    border-radius: 18px;
    color: white;
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.18);
    animation: fadeInUp 0.25s ease-out;
}

.toast-info {
    background: linear-gradient(135deg, #0f5a8b, #1570a6);
}

.toast-success {
    background: linear-gradient(135deg, #0b8b67, #00a878);
}

.toast-error {
    background: linear-gradient(135deg, #b42318, #e63946);
}

.toast-title {
    font-weight: 700;
}

.toast-message {
    margin-top: 4px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.86);
}

/* 背景装饰 - 优化后的动态效果 */
body::before {
    content: '';
    position: fixed;
    top: -40%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(15, 90, 139, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    left: -5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 168, 120, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: float 15s ease-in-out infinite reverse;
}

/* ================================ */
/* 模块三：表单元素样式 */
/* ================================ */

/* 输入框样式 - 优化后的现代设计 */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
    padding: 14px 16px;
    border: 1.5px solid var(--neutral-300);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-family: inherit;
    color: var(--neutral-700);
    background-color: white;
    transition: all var(--transition-normal);
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 带货币符号的输入框 */
.input-with-prefix {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral-500);
    font-weight: 600;
    font-size: var(--text-base);
    pointer-events: none;
    z-index: 1;
}

.input-with-prefix input {
    padding-left: 48px;
}

/* 输入框状态 */
input[type="text"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
select:hover,
textarea:hover {
    border-color: var(--primary-light);
    background-color: var(--neutral-50);
    box-shadow: 0 2px 4px rgba(15, 90, 139, 0.1);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 4px var(--primary-lighter);
    transform: translateY(-1px);
}

/* 定价 SOP：前缀+输入组合框 — 内层取消全局 input 边框与阴影（避免与外层容器双线框） */
.pricing-input-group input[type="number"].pricing-input-inner,
.pricing-input-group input[type="text"].pricing-input-inner {
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
    outline: none;
}

.pricing-input-group input[type="number"].pricing-input-inner:hover,
.pricing-input-group input[type="text"].pricing-input-inner:hover,
.pricing-input-group input[type="number"].pricing-input-inner:focus,
.pricing-input-group input[type="text"].pricing-input-inner:focus {
    border: none;
    box-shadow: none;
    transform: none;
    background: transparent;
}

input:disabled,
select:disabled {
    background-color: var(--neutral-100);
    color: var(--neutral-500);
    cursor: not-allowed;
    border-color: var(--neutral-200);
}

/* 选择框样式 - 优化后的下拉箭头 */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 10 12 14 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

/*
 * 定价 SOP 下拉触发器（原生 select 或用 JS 换成 button）：
 * Tailwind px-* 会压扁全局 select 的 padding-right，故此处写死右侧留白给箭头。
 */
select.pricing-param-select:not(.pricing-custom-select-native),
button.pricing-custom-select__trigger.pricing-param-select {
    min-height: 48px;
    height: auto;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    padding-left: 1rem;
    padding-right: 3rem;
    text-align: left;
    border-radius: var(--radius-xl);
    border-width: 1px;
    border-style: solid;
    border-color: var(--neutral-200);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 10 12 14 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.125rem 1.125rem;
    box-shadow: var(--shadow-sm);
}

button.pricing-custom-select__trigger.pricing-param-select {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    font-family: inherit;
    font-size: var(--text-base);
    color: var(--neutral-800);
    cursor: pointer;
}

/*
 * 三列栅格列宽有限时，单行省略会导致「中端定位 · 推荐」变成「中端定…」；
 * 允许换行并由按钮 min-height + auto 增高，保证选中项完整可读。
 */
.pricing-custom-select__value {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    line-height: 1.4;
    padding-right: 0.35rem;
    text-align: left;
}

select.pricing-param-select:not(.pricing-custom-select-native):hover,
button.pricing-custom-select__trigger.pricing-param-select:hover {
    border-color: var(--neutral-300);
}

select.pricing-param-select:not(.pricing-custom-select-native):focus,
button.pricing-custom-select__trigger.pricing-param-select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(15, 90, 139, 0.18);
    transform: none;
}

/* 隐藏增强后的原生 select，仍参与表单提交与校验 */
select.pricing-custom-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.pricing-custom-select {
    position: relative;
    display: block;
    width: 100%;
}

.pricing-custom-select__list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 60;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-height: 16rem;
    overflow-y: auto;
}

.pricing-custom-select__option {
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.9375rem;
    line-height: 1.35;
    color: var(--neutral-700);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.pricing-custom-select__option:hover,
.pricing-custom-select__option:focus-visible {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    outline: none;
}

.pricing-custom-select__option[aria-selected="true"] {
    background: rgba(15, 90, 139, 0.06);
    font-weight: 600;
    color: var(--neutral-800);
}

.pricing-custom-select__option--disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* 定价 SOP：分段单选（替代站点 / 产品类型下拉） */
.pricing-segment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

@media (min-width: 640px) {
    .pricing-segment-grid:not(.pricing-segment-grid--sites) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .pricing-segment-grid--sites {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.pricing-segment {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--neutral-200);
    background: var(--neutral-50);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--neutral-700);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.pricing-segment:hover {
    border-color: var(--neutral-300);
    background: #fff;
}

.pricing-segment input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    overflow: hidden;
}

.pricing-segment span {
    line-height: 1.3;
    pointer-events: none;
}

.pricing-segment:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-lighter);
    color: var(--primary-dark);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(15, 90, 139, 0.12);
}

.pricing-segment:has(input:focus-visible) {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ================================ */
/* 模块四：卡片样式 */
/* ================================ */

/* 卡片样式 - 优化后的现代设计 */
.card {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 10s ease-in-out infinite;
}

.card-header-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.card-header-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.card:hover .card-header-icon {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.card-header-text h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: 4px;
}

.card-header-text p {
    font-size: var(--text-sm);
    opacity: 0.9;
}

/* 卡片变体 */
.card-accent {
    border-top: 4px solid var(--accent);
}

.card-success {
    border-top: 4px solid var(--success);
}

.card-warning {
    border-top: 4px solid var(--warning);
}

.card-danger {
    border-top: 4px solid var(--danger);
}

/* 表单内容 */
.form-body {
    padding: 40px;
}

/* ================================ */
/* 模块五：动画效果 */
/* ================================ */

/* 动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ================================ */
/* 模块六：交互效果 */
/* ================================ */

/* 加载动画 */
.spinner {
    animation: spin 1s ease-in-out infinite;
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-bounce {
    animation: bounce 0.5s ease-in-out;
}

/* 按钮点击涟漪效果 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* 输入框成功状态 */
.input-success {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 4px var(--success-light) !important;
}

/* 表单提交状态 */
.form-submitting {
    opacity: 0.8;
    pointer-events: none;
}

/* 页面滚动动画 */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================ */
/* 模块七：响应式设计 */
/* ================================ */

/* 响应式设计 */
@media (max-width: 768px) {
    .form-body {
        padding: 24px;
    }

    .card-header {
        padding: 20px;
    }

    .form-row-cols-2,
    .form-row-cols-3 {
        grid-template-columns: 1fr;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    .page-hero {
        padding: 12px 14px;
        border-radius: 18px;
    }

    .page-hero-card {
        padding: 10px 12px;
    }
}

@media (min-width: 768px) {
    .page-hero {
        grid-template-columns: minmax(0, 1.65fr) minmax(220px, 0.95fr);
        align-items: center;
    }
}

@media (min-width: 1024px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        transform: none;
        width: 320px;
        height: 100vh;
        flex-shrink: 0;
    }

    .app-overlay,
    .topbar-menu-button {
        display: none;
    }

    .app-main {
        padding: 24px 26px 28px 0;
    }

    .page-wrap {
        padding-top: 14px;
    }
}

/* ================================ */
/* 模块八：深色模式支持 */
/* ================================ */

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #0F172A 0%, #1A2D4D 100%);
        color: var(--neutral-300);
    }

    html {
        scrollbar-color: rgba(76, 201, 240, 0.5) rgba(30, 41, 59, 0.92);
    }

    html::-webkit-scrollbar-track {
        background: rgba(30, 41, 59, 0.92);
    }

    html::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, rgba(25, 117, 176, 0.95), rgba(0, 168, 120, 0.8));
        border-color: rgba(30, 41, 59, 0.92);
    }

    html::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, #1570a6, #00a878);
    }

    .card {
        background: var(--neutral-800);
        color: var(--neutral-300);
    }

    .form-label {
        color: var(--neutral-200);
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    select,
    textarea {
        background-color: var(--neutral-900);
        border-color: var(--neutral-700);
        color: var(--neutral-200);
    }

    input[type="text"]:hover,
    input[type="number"]:hover,
    input[type="email"]:hover,
    select:hover,
    textarea:hover {
        background-color: var(--neutral-800);
        border-color: var(--neutral-600);
    }

    input[type="text"]:focus,
    input[type="number"]:focus,
    input[type="email"]:focus,
    select:focus,
    textarea:focus {
        background-color: var(--neutral-900);
    }

    select.pricing-param-select:not(.pricing-custom-select-native),
    button.pricing-custom-select__trigger.pricing-param-select {
        background-color: var(--neutral-900);
        border-color: var(--neutral-700);
        color: var(--neutral-200);
    }

    button.pricing-custom-select__trigger.pricing-param-select {
        color: var(--neutral-200);
    }

    select.pricing-param-select:not(.pricing-custom-select-native):focus,
    button.pricing-custom-select__trigger.pricing-param-select:focus {
        background-color: var(--neutral-900);
        box-shadow: 0 0 0 2px rgba(25, 117, 176, 0.35);
        transform: none;
    }

    select.pricing-param-select:not(.pricing-custom-select-native):hover,
    button.pricing-custom-select__trigger.pricing-param-select:hover {
        background-color: var(--neutral-800);
        border-color: var(--neutral-600);
    }

    .pricing-custom-select__list {
        background: var(--neutral-800);
        border-color: var(--neutral-600);
        box-shadow: var(--shadow-xl);
    }

    .pricing-custom-select__option {
        color: var(--neutral-200);
    }

    .pricing-custom-select__option:hover,
    .pricing-custom-select__option:focus-visible {
        background: rgba(15, 90, 139, 0.28);
        color: var(--neutral-50);
    }

    .pricing-custom-select__option[aria-selected="true"] {
        background: rgba(15, 90, 139, 0.18);
        color: var(--neutral-50);
    }

    .pricing-segment {
        border-color: var(--neutral-600);
        background: var(--neutral-900);
        color: var(--neutral-300);
    }

    .pricing-segment:hover {
        border-color: var(--neutral-500);
        background: var(--neutral-800);
    }

    .pricing-segment:has(input:checked) {
        border-color: var(--primary-light);
        background: rgba(15, 90, 139, 0.35);
        color: var(--neutral-50);
        box-shadow: inset 0 0 0 1px rgba(25, 117, 176, 0.35);
    }

    /* 深色模式下组合框内层仍需透明，避免被上一段全局 input:focus 盖住 */
    .pricing-input-group input[type="number"].pricing-input-inner,
    .pricing-input-group input[type="text"].pricing-input-inner {
        background: transparent;
        border: none;
        box-shadow: none;
    }

    .pricing-input-group input[type="number"].pricing-input-inner:hover,
    .pricing-input-group input[type="text"].pricing-input-inner:hover,
    .pricing-input-group input[type="number"].pricing-input-inner:focus,
    .pricing-input-group input[type="text"].pricing-input-inner:focus {
        background: transparent;
        border: none;
        box-shadow: none;
        transform: none;
    }

    .form-hint {
        color: var(--neutral-400);
    }

    .form-hint-info {
        background: rgba(15, 90, 139, 0.2);
        color: var(--primary-light);
    }

    .tips-card {
        background: rgba(0, 168, 120, 0.1);
    }

    .loading-state {
        background: var(--neutral-900);
    }

    .section-title {
        border-bottom-color: var(--neutral-700);
    }

    .sidebar-card {
        background: var(--neutral-800);
        border-color: var(--neutral-700);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    }

    .sidebar-link {
        color: var(--neutral-300);
    }

    .sidebar-link:hover {
        background: rgba(255, 255, 255, 0.06);
        color: var(--neutral-100);
    }

    .sidebar-link.active {
        background: rgba(15, 90, 139, 0.35);
        border-color: rgba(25, 117, 176, 0.35);
        color: var(--neutral-50);
    }

    .sidebar-link-icon {
        background: rgba(255, 255, 255, 0.08);
        color: var(--primary-light);
    }

    .sidebar-link.active .sidebar-link-icon {
        background: rgba(15, 90, 139, 0.45);
        color: #fff;
    }

    .sidebar-footer {
        background: var(--neutral-900);
        border-color: var(--neutral-700);
    }

    .sidebar-footer p {
        color: var(--neutral-200);
    }

    .sidebar-footer span {
        color: var(--neutral-400);
    }
}
