/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1a202c;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    min-height: 100vh;
    padding: 2rem 1rem;
    max-width: 80rem;
    margin: 0 auto;
}

/* 主布局 */
.main-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.calculator-section {
    flex: 1;
    min-width: 0;
}

.sidebar-section {
    width: 320px;
    flex-shrink: 0;
}

@media (max-width: 1200px) {
    .sidebar-section {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }
    .sidebar-section {
        display: block;
        width: 100%;
    }
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.title .icon {
    margin-right: 0.5rem;
}

.subtitle {
    margin-top: 0.75rem;
    font-size: 1rem;
    color: #718096;
    font-weight: 400;
}

/* 卡片样式 */
.calculator-card, .sidebar-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calculator-card:hover, .sidebar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.form-label .icon {
    margin-right: 0.375rem;
}

.input-wrapper {
    position: relative;
}

.form-input, .form-textarea {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #2d3748;
    background-color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.form-textarea {
    height: 120px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    resize: vertical;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #4299e1;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.input-suffix {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 0.75rem;
    font-weight: 500;
    pointer-events: none;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* 预览区域 */
.preview-container {
    margin-top: 1.5rem;
    background-color: #f7fafc;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 320px;
    padding: 1rem;
}

#gradientCanvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* 按钮样式 */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 153, 225, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
}

/* 侧边栏辅助样式 */
.sidebar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
}

.sidebar-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #4299e1, #63b3ed);
    border-radius: 1px;
}

.tip-item {
    padding: 1rem;
    background: rgba(247, 250, 252, 0.8);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.tip-item:hover {
    background: rgba(247, 250, 252, 1);
    transform: translateX(2px);
}

.tip-item h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.tip-item p {
    font-size: 0.8rem;
    color: #4a5568;
    line-height: 1.5;
}

.related-tools {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tool-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(247, 250, 252, 0.8);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tool-link:hover {
    background: rgba(66, 153, 225, 0.1);
    border-color: #4299e1;
    transform: translateY(-1px);
}

.tool-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(66, 153, 225, 0.1);
    border-radius: 6px;
}

.tool-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.125rem;
}

.tool-info p {
    font-size: 0.75rem;
    color: #4a5568;
}
