/* ========================================
   CSS 渐变生成工具样式
   ======================================== */

/* 主内容 */
.main-content { 
    width: 100%; 
    max-width: 900px;
    height: calc(100vh - 120px); 
    display: flex; 
    align-items: center; 
    padding: 0 20px; 
    padding-bottom: 50px; 
    z-index: 10; 
}
.container { width: 100%; height: 100%; }
.tool-card { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-xl); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    width: 100%;
    height: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* 预览区 */
.preview-container {
    position: relative;
    height: 250px;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239C92AC' fill-opacity='0.15' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
    flex-shrink: 0;
}
.gradient-box {
    width: 100%;
    height: 100%;
}
.overlay-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
}

/* 控制区 */
.controls-area {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

/* 设置面板 */
.settings-panel {
    flex: 1.5;
    padding: 20px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}
.setting-group { margin-bottom: 20px; }
.setting-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }
#angleValue { color: var(--primary-color); font-family: monospace; }

.type-selector { display: flex; gap: 10px; }
.type-btn {
    flex: 1;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
}
.type-btn:hover { background: rgba(255,255,255,0.1); }
.type-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

input[type="range"] {
    width: 100%;
    cursor: pointer;
}

/* 色标列表 */
.color-stops-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}
.color-stop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid transparent;
}
.color-stop-item:hover { border-color: var(--border-color); }

.color-input {
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: none; border-radius: 4px; }

.pos-input {
    width: 50px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
    outline: none;
}
.pos-input:focus { border-color: var(--primary-color); }

.btn-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: auto;
    padding: 4px;
    transition: 0.2s;
}
.btn-remove:hover { color: var(--primary-color); }

.btn-add {
    width: 100%;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
}
.btn-add:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

/* 代码面板 */
.code-panel {
    flex: 1;
    background: rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.panel-header {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.btn-copy { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; transition: 0.2s; padding: 4px; }
.btn-copy:hover { color: var(--text-primary); }

#codeOutput {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-family: var(--font-mono, 'Consolas', 'Monaco', monospace);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    overflow: auto;
}

/* 响应式 */
@media (max-width: 768px) {
    .controls-area { flex-direction: column; }
    .settings-panel { border-right: none; border-bottom: 1px solid var(--border-color); height: auto; overflow-y: visible; }
    .code-panel { height: 150px; }
    .preview-container { height: 180px; }
}
