/* 通用样式 */
:root {
    --primary: #d32f2f;
}

body {
    font-family: "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    margin: 0;
    padding: 0;
}

header {
    background: white;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    text-align: center;
}

main {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.app-container {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 30px;
    max-width: 1050px;
    width: 100%;
}

.controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 90vh;
    overflow-y: auto;
    padding-right: 15px;
}

.control-group {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.control-item:last-child {
    margin-bottom: 0;
}

h1 {
    margin: 0;
    color: #333;
    font-size: 28px;
}

h2 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

h3 {
    margin: 0;
    color: #333;
    font-size: 14px;
}

p {
    margin: 8px 0 0 0;
    color: #666;
    font-size: 14px;
}

label {
    font-size: 13px;
    color: #444;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

label span {
    color: var(--primary);
    font-size: 11px;
}

input[type="text"],
select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

input[type="range"] {
    cursor: pointer;
    height: 6px;
    width: 100%;
}

input[type="color"] {
    width: 100%;
    height: 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

input[type="radio"] {
    margin-right: 5px;
}

.radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.radio-item {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #eee;
}

canvas {
    background-color: #fff;
    border: 1px solid #f0f0f0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
    font-size: 14px;
}

.btn-main {
    background: var(--primary);
    color: white;
}

.btn-sub {
    background: #444;
    color: white;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

footer {
    background: #f8f9fa;
    border-top: 1px solid #eee;
    padding: 30px 20px;
    text-align: center;
}

footer p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

footer p:last-child {
    margin-bottom: 0;
}

footer nav {
    margin-top: 15px;
    font-size: 12px;
}

footer nav a {
    color: #666;
    text-decoration: none;
    margin: 0 8px;
}

footer nav a:hover {
    color: var(--primary);
    text-decoration: underline;
}

footer span {
    color: #ddd;
    margin: 0 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        gap: 20px;
    }

    .preview-area {
        border-left: none;
        border-top: 1px solid #eee;
        padding-top: 20px;
    }

    .controls {
        padding-right: 0;
        max-height: none;
    }

    h1 {
        font-size: 24px;
    }

    header {
        padding: 15px 0;
    }
}
