/* 设置页面样式 */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.settings-section {
    background-color: var(--color-gray-900);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.settings-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--color-white);
    border-bottom: 1px solid var(--color-gray-800);
    padding-bottom: 10px;
}

.cookie-editor {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border-radius: 4px;
    background-color: var(--color-gray-800);
    color: var(--color-white);
    font-family: monospace;
    resize: vertical;
    border: 1px solid var(--color-gray-700);
}

.cookie-editor:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-gray-400);
}

.form-actions {
    margin-top: 15px;
}

.action-btn {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: var(--color-primary-hover);
}

.browser-select {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.radio-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--color-gray-400);
}

.radio-container input[type="radio"] {
    margin-right: 8px;
}

.radio-label {
    font-size: 1.0rem;
}

.fetch-status {
    margin-top: 15px;
    padding: 10px;
    background-color: var(--color-gray-800);
    border-radius: 4px;
    color: var(--color-gray-400);
    font-size: 0.875rem;
}

.status-success {
    color: var(--color-success);
}

.status-error {
    color: var(--color-error);
}

/* Cookie引导步骤样式 */
.cookie-guide {
    background-color: var(--color-gray-900);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cookie-guide h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-gray-800);
    padding-bottom: 10px;
}

.guide-steps {
    padding-left: 25px;
    margin-bottom: 10px;
}

.guide-steps li {
    margin-bottom: 12px;
    color: var(--color-white);
    line-height: 1.5;
}

.guide-steps strong {
    color: var(--color-primary);
}

/* 打开浏览器按钮样式 */
.open-browser-btn {
    background-color: var(--color-success);
    margin-left: 10px;
    padding: 6px 12px;
    font-size: 0.875rem;
}

.open-browser-btn:hover {
    background-color: var(--color-success-dark);
}

/* Cookie Tab 切换样式 */
.cookie-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-gray-800);
}

.cookie-tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    color: var(--color-gray-400);
    cursor: pointer;
    font-size: 1.0rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.cookie-tab-btn:hover {
    color: var(--color-white);
    background-color: var(--color-gray-800);
}

.cookie-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background-color: var(--color-gray-900);
}

/* Cookie 公共输入区样式 */
.cookie-common-section {
    background-color: var(--color-gray-900);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Cookie Tab 内容区样式 */
.cookie-tab-content {
    background-color: var(--color-gray-900);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.agent-settings-card {
    margin-bottom: 24px;
}

.agent-key-card {
    padding: 24px;
    background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
    border: 1px solid #eadfc7;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.agent-key-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.agent-key-header h3 {
    margin: 0;
    color: var(--color-text-primary);
}

.agent-key-subtitle {
    margin: 6px 0 0;
    color: var(--color-text-secondary);
    line-height: 1.6;
    font-size: var(--font-size-sm);
}

.agent-key-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-key-toggle {
    padding: 6px 14px;
    border: 1px solid var(--color-border-primary);
    border-radius: 999px;
    background-color: var(--color-white);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: var(--transition-all);
}

.agent-key-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.agent-key-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 4px 12px;
    border-radius: 999px;
    background-color: #f3f4f6;
    color: #374151;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
}

.agent-key-status.active {
    background-color: #dcfce7;
    color: #166534;
}

.agent-key-status.disabled {
    background-color: #fee2e2;
    color: #991b1b;
}

.agent-key-body {
    display: grid;
    gap: 12px;
}

.agent-key-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e5e7eb;
}

.agent-key-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.agent-key-label {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.agent-key-value {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background-color: #111827;
    color: #f9fafb;
    font-size: var(--font-size-sm);
}

.agent-key-meta {
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
}

.agent-skill-link {
    color: var(--color-primary);
    font-size: var(--font-size-sm);
    word-break: break-all;
    text-decoration: none;
}

.agent-skill-link:hover {
    text-decoration: underline;
}

.agent-key-once {
    margin-top: 16px;
    padding: 16px;
    border-radius: var(--radius-base);
    background-color: #111827;
    color: #f9fafb;
}

.agent-key-once-title {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.75;
}

.agent-key-once-value {
    margin: 10px 0 14px;
    word-break: break-all;
    font-family: monospace;
    font-size: var(--font-size-base);
}

.agent-key-actions,
.agent-key-copy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.agent-key-actions {
    margin-top: 16px;
}

.agent-key-panel {
    margin-top: 16px;
}

.agent-key-tip {
    margin-top: 12px;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .agent-key-header,
    .agent-key-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .agent-key-header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* 获取方式面板样式 */
.cookie-method-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.method-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.method-actions label {
    color: var(--color-gray-400);
    font-weight: 500;
    margin-right: 10px;
}

.method-browser-select {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.method-browser-select label {
    color: var(--color-gray-400);
    font-weight: 500;
}

.method-status {
    padding: 15px;
    background-color: var(--color-gray-800);
    border-radius: 6px;
}

.method-guide {
    padding: 15px;
    background-color: var(--color-gray-800);
    border-radius: 6px;
    border-left: 4px solid var(--color-primary);
}

.method-guide h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--color-primary);
    font-size: 1.0rem;
}

.method-guide .guide-steps {
    padding-left: 20px;
    margin-bottom: 0;
}

.method-guide .guide-steps li {
    margin-bottom: 8px;
    color: var(--color-gray-400);
    line-height: 1.4;
}

/* ==================== 默认Bot设置样式 - 扁平化布局 ==================== */
.defaults-description {
    padding: 14px 16px;
    background: var(--color-gray-100);
    border-left: 3px solid var(--color-gray-400);
    border-radius: 4px;
    margin-bottom: 20px;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.defaults-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
}

.default-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.default-card:hover {
    border-color: var(--color-gray-400);
    background: var(--color-bg-tertiary);
}

.default-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.default-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.default-card-title i {
    font-size: 20px;
    color: var(--color-gray-600);
}

.usage-desc {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.current-bot {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.current-bot .label {
    color: var(--color-text-secondary);
}

.current-bot .bot-name {
    color: var(--color-text-primary);
    font-weight: 500;
}

.btn-change-default {
    padding: 8px 20px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-change-default:hover {
    background: var(--color-primary-dark);
}

/* ==================== Bot选择器弹窗样式 ==================== */
.bot-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.bot-selector-content {
    background: var(--color-bg-primary);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.bot-selector-content .modal-body {
    overflow-y: auto;
    padding: 20px;
}

.bot-selector-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bot-selector-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.bot-selector-item:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-tertiary);
}

.bot-info {
    flex: 1;
}

.bot-info h4 {
    margin: 0 0 8px 0;
    color: var(--color-text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.bot-info p {
    margin: 0 0 8px 0;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.bot-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--color-primary);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.bot-badge.user-badge {
    background: var(--color-success);
}

.btn-select-bot {
    padding: 8px 20px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-select-bot:hover {
    background: var(--color-primary-dark);
    transform: scale(1.05);
}
