/* ============================================================
   【新增】Web 模式模态框：与宣言/设置模态框同款水晶铭牌风格
   ============================================================ */
.web-mode-modal .modal-content {
    background: rgba(25, 25, 25, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(0, 223, 216, 0.1);
    border-radius: 12px;
    max-width: 640px;
    width: 92%;
    margin: 4% auto;
    padding: 10px 36px 32px;
    position: relative;
}

/* 标题：与 #apiSettingsModal 同款流光渐变 */
.web-mode-modal .web-mode-title {
    font-family: 'Playfair Display', 'Ma Shan Zheng', serif;
    font-size: 1.4em;
    text-align: center;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin: 8px 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    background: linear-gradient(90deg, #007CF0, #00D4FF, #007CF0);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 0 5px rgba(0, 223, 216, 0.3));
    animation: colorWave 7s linear infinite;
}
.web-mode-modal .web-mode-title i {
    background: inherit;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 顶部说明 */
.web-mode-modal .web-mode-hint {
    text-align: center;
    color: var(--dark-text-secondary);
    font-size: 0.88em;
    line-height: 1.7;
    margin: 0 0 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* 分组 */
.web-mode-modal .web-mode-section {
    margin-bottom: 18px;
}

/* 标签行 */
.web-mode-modal .web-mode-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: 'Noto Serif SC', 'Playfair Display', serif;
    font-size: 0.95em;
    color: var(--dark-accent);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* 复制状态 */
.web-mode-modal .web-mode-copy-status {
    font-size: 0.78em;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0;
    flex: 1;
    text-align: right;
    transition: opacity 0.3s;
}

/* 小按钮：重新复制 */
.web-mode-modal .web-mode-mini-btn {
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.4);
    color: var(--dark-accent);
    font-size: 0.78em;
    padding: 3px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Poppins', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.web-mode-modal .web-mode-mini-btn:hover {
    background: rgba(74, 144, 226, 0.25);
    border-color: var(--dark-accent);
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.25);
}

/* 大模型选择行 */
.web-mode-modal .web-mode-llm-bar {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.web-mode-modal .web-mode-llm-bar select {
    flex: 1;
    padding: 10px 12px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-family: 'Noto Serif SC', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}
.web-mode-modal .web-mode-llm-bar select:focus {
    border-color: #00DFD8;
    box-shadow: 0 0 10px rgba(0, 223, 216, 0.15);
    background-color: rgba(0, 0, 0, 0.5);
}
.web-mode-modal .web-mode-llm-bar select option {
    background-color: #1e1e1e;
    color: #fff;
}

/* 文本域：与设置模态框输入框风格一致 */
.web-mode-modal textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--dark-text-primary);
    font-family: var(--font-family-novel);
    font-size: 0.9rem;
    line-height: 1.65;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.web-mode-modal textarea:focus {
    outline: none;
    border-color: #00DFD8;
    box-shadow: 0 0 10px rgba(0, 223, 216, 0.15);
    background-color: rgba(0, 0, 0, 0.5);
}
.web-mode-modal textarea[readonly] {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--dark-text-secondary);
    cursor: text;
}

/* 底部按钮组 */
.web-mode-modal .web-mode-actions {
    display: flex;
    gap: 14px;
    margin-top: 22px;
    justify-content: center;   /* ← 新增：整组居中 */
}

/* 主按钮：与设置模态框 save-btn 同款青蓝渐变 */
.web-mode-modal .web-mode-btn-primary {
   flex: 0 1 auto;            /* ← 改这里：按内容宽度，允许收缩 */
    padding: 12px 36px;        /* ← 左右 padding 加大，视觉更饱满 */
    background: linear-gradient(135deg, #00D4FF 0%, #4a90e2 100%);
    color: #000;
    font-weight: 700;
    font-size: 1em;
    font-family: 'Playfair Display', 'Noto Serif SC', sans-serif;
    letter-spacing: 1px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 223, 216, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.web-mode-modal .web-mode-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 223, 216, 0.5);
    filter: brightness(1.1);
}
.web-mode-modal .web-mode-btn-primary:active {
    transform: translateY(0);
}

/* 幽灵按钮：清空 */
.web-mode-modal .web-mode-btn-ghost {
    flex: 0 0 auto;            /* 保持不变 */
    padding: 12px 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--dark-text-secondary);
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95em;
    font-family: 'Noto Serif SC', sans-serif;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.web-mode-modal .web-mode-btn-ghost:hover {
    border-color: var(--dark-accent);
    color: var(--dark-accent);
    background: rgba(74, 144, 226, 0.08);
}

/* 关闭按钮：复用全局 .close-button 的旋转 hover，无需重写 */

/* 移动端适配 */
@media (max-width: 480px) {
    .web-mode-modal .modal-content {
        padding: 8px 20px 24px;
        max-width: 96%;
        margin: 3% auto;
    }
    .web-mode-modal .web-mode-title {
        font-size: 1.15em;
        letter-spacing: 0.5px;
    }
    .web-mode-modal .web-mode-hint {
        font-size: 0.82em;
    }
    .web-mode-modal .web-mode-llm-bar {
        flex-direction: column;
    }
    .web-mode-modal .web-mode-actions {
        flex-direction: column;
    }
    .web-mode-modal .web-mode-btn-ghost {
        justify-content: center;
    }
}


/* Context / 模式徽章条 */
.web-mode-modal .web-mode-badge-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: -6px 0 18px;
}

.web-mode-modal .web-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.76em;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.3px;
    animation: badgeFadeIn 0.4s ease;
}

@keyframes badgeFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.web-mode-modal .web-mode-badge-ctx {
    background: linear-gradient(135deg, 
        rgba(0, 223, 216, 0.15), 
        rgba(74, 144, 226, 0.15));
    border: 1px solid rgba(0, 223, 216, 0.4);
    color: #00DFD8;
}

.web-mode-modal .web-mode-badge-mode {
    background: linear-gradient(135deg, 
        rgba(121, 40, 202, 0.15), 
        rgba(74, 144, 226, 0.15));
    border: 1px solid rgba(121, 40, 202, 0.4);
    color: #b794f6;
}

/* ============================================================
   【新增】Web 模式徽章 - 移动端适配
   ============================================================ */
@media (max-width: 480px) {
    .web-mode-modal .web-mode-badge-bar {
        gap: 6px;                    /* 从 8px 收紧 */
        margin: -6px 0 14px;         /* 负 margin 减半，避免贴脸 */
        justify-content: center;
    }

    .web-mode-modal .web-mode-badge {
        /* 关键：改用 rem，脱离父级 font-size 影响 */
        font-size: 0.72rem;          /* ≈ 11.5px，够看清 */
        padding: 3px 10px;           /* 稍微收窄内边距 */
        gap: 4px;                    /* 图标与文字间距收紧 */
        line-height: 1.4;
        
        /* 防止极端长文本撑破容器 */
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .web-mode-modal .web-mode-badge i {
        font-size: 0.85em;           /* 图标独立控制，不跟着数字变 */
        flex-shrink: 0;              /* 图标不被压缩 */
    }
}

/* ============================================================
   【建议同时加】空状态不占位（桌面 + 移动通用）
   ============================================================ */
.web-mode-modal .web-mode-badge-bar:empty {
    display: none;
}
