/* =========================================
   SETTINGS 页面完整样式 (两列网格布局)
   ========================================= */

/* 卡片基础样式 */
.card-settings {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-header {
    margin-bottom: 16px;
}

.card-title {
    font-size: 15px;
    color: #e6edf3;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.card-subtitle {
    font-size: 11px;
    color: #8b949e;
    margin: 0;
}

/* ========== 1. 预设配置网格 ========== */
.profiles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.profile-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-item:active {
    background: #11161d;
    border-color: #2e8b57;
    transform: translateY(1px);
}

.profile-icon-box {
    width: 40px;
    height: 40px;
    background: rgba(46, 139, 87, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-icon {
    font-size: 20px;
    color: #2e8b57;
}

.profile-content {
    flex: 1;
}

.profile-name {
    font-size: 14px;
    color: #e6edf3;
    font-weight: 600;
    margin-bottom: 2px;
}

.profile-desc {
    font-size: 11px;
    color: #8b949e;
}

.btn-profile-action {
    background: rgba(46, 139, 87, 0.2);
    border: 1px solid #2e8b57;
    color: #2e8b57;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-profile-action:active {
    background: rgba(46, 139, 87, 0.3);
    transform: scale(0.95);
}

/* ========== 2. 两列网格布局 ========== */
.settings-grid-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 12px;
}

.setting-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-field.full-width {
    grid-column: 1 / -1;
}

.setting-label {
    font-size: 11px;
    color: #8b949e;
    font-weight: 600;
    text-transform: uppercase;
}

.setting-select,
.setting-input {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 6px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}

.setting-select:focus,
.setting-input:focus {
    border-color: #2e8b57;
    outline: none;
}

/* 带单位的输入框 */
.input-with-unit {
    position: relative;
}

.input-with-unit .setting-input {
    padding-right: 40px;
}

.input-unit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #8b949e;
    pointer-events: none;
}

/* 带重置按钮的输入框 */
.input-with-action {
    position: relative;
}

.input-with-action .setting-input {
    padding-right: 36px;
}

.btn-reset-small {
    position: absolute;
    right: 0;
    top: 0;
    height: 36px;
    width: 36px;
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 16px;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
}

.btn-reset-small:active {
    color: #2e8b57;
    background: rgba(46, 139, 87, 0.1);
}

/* ========== 3. 标签按钮 ========== */
.tags-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.btn-tag {
    background: #30363d;
    border: 1px solid #30363d;
    color: #8b949e;
    border-radius: 6px;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-tag.active {
    background: rgba(46, 139, 87, 0.2);
    border-color: #2e8b57;
    color: #2e8b57;
}

.btn-tag:active {
    transform: scale(0.95);
}

/* ========== 4. 语言按钮 ========== */
.lang-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-lang {
    background: #30363d;
    border: 1px solid #30363d;
    color: #8b949e;
    border-radius: 6px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-lang.active {
    background: rgba(46, 139, 87, 0.2);
    border-color: #2e8b57;
    color: #2e8b57;
}

/* ========== 5. 数据管理部分 ========== */
.settings-section {
    margin-bottom: 16px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 12px;
    color: #8b949e;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.btn-action {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action:active {
    background: #11161d;
    transform: translateY(1px);
}

.btn-sync {
    border-color: #3498db;
}

.btn-icon {
    font-size: 16px;
}

.btn-text {
    font-size: 10px;
    color: #8b949e;
    font-weight: 600;
    text-transform: uppercase;
}

/* ========== 6. 底部按钮 ========== */
.settings-footer {
    position: fixed;
    bottom: 80px;
    left: 12px;
    right: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: linear-gradient(to bottom, transparent, #0a0a0a 30%);
    padding: 12px 0 20px;
}

.btn-settings-cancel,
.btn-settings-save {
    height: 44px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-settings-cancel {
    background: #30363d;
    color: #8b949e;
}

.btn-settings-cancel:active {
    background: #39414a;
}

.btn-settings-save {
    background: rgba(46, 139, 87, 0.2);
    border: 1px solid #2e8b57;
    color: #2e8b57;
}

.btn-settings-save:active {
    background: rgba(46, 139, 87, 0.3);
    transform: scale(0.98);
}

/* ========== 7. 响应式调整 ========== */
@media (max-width: 380px) {
    .settings-grid-two-col {
        grid-template-columns: 1fr;
    }
    
    .action-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn-sync {
        grid-column: 1 / -1;
    }
}
/* 修改Settings页面容器高度 */
#settings-view.page-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    background: #0a0a0a;
    z-index: 9999;  /* ← 改为更高的z-index */
    overflow-y: auto;
}

/* 确保底部导航在Settings之上 */
#bottom-nav {
    z-index: 1000 !important;
    position: relative; /* 或保持fixed */
}
/* 设置项描述文字 */
.setting-description {
    font-size: 10px;
    color: #8b949e;
    margin-top: 4px;
    line-height: 1.3;
}
/* 操作按钮行样式 */
.action-buttons-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #30363d;
}

.btn-action-back,
.btn-action-save {
    height: 44px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action-back {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #8b949e;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-action-back:active {
    background: #11161d;
    transform: scale(0.98);
}

.btn-action-save {
    background: #2e8b57;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(46, 139, 87, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-action-save:active {
    background: #257d4a;
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(46, 139, 87, 0.2);
}
