/* 古典风格 CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: #f4f1e8;
    color: #2c1810;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #8b6f47 0%, #6d5438 100%);
    border: 3px solid #5a4a35;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

header h1 {
    font-size: 2.5em;
    color: #f4f1e8;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 10px;
}

.subtitle {
    color: #e8dcc8;
    font-size: 1.1em;
    font-style: italic;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 3px solid #8b6f47;
}

.tab {
    flex: 1;
    padding: 15px;
    background: #d4c4a8;
    border: 2px solid #8b6f47;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    color: #2c1810;
    transition: all 0.3s;
}

.tab:hover {
    background: #c4b498;
}

.tab.active {
    background: #f4f1e8;
    border-bottom: 3px solid #f4f1e8;
    margin-bottom: -3px;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.card, .card-full {
    background: #fff;
    border: 3px solid #8b6f47;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-full {
    margin-bottom: 20px;
}

.card h2, .card-full h2 {
    color: #5a4a35;
    border-bottom: 2px solid #8b6f47;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.upload-area {
    text-align: center;
    margin-bottom: 20px;
}

.canvas-container, .decode-canvas-container {
    background: #2c2c2c;
    border: 3px solid #5a4a35;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 20px;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.decode-canvas-container {
    min-height: 400px;
}

canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #666;
}

.controls {
    margin-top: 20px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #5a4a35;
}

.control-group input[type="text"],
.control-group input[type="number"],
.control-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #8b6f47;
    border-radius: 5px;
    font-size: 1em;
    background: #faf8f3;
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    background: #d4c4a8;
    border-radius: 5px;
    outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #8b6f47;
    border: 2px solid #5a4a35;
    border-radius: 50%;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #8b6f47;
    border: 2px solid #5a4a35;
    border-radius: 50%;
    cursor: pointer;
}

.control-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 2px solid #8b6f47;
    border-radius: 5px;
    cursor: pointer;
}

.control-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.mode-info {
    background: #f9f6f0;
    border: 2px solid #8b6f47;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
}

.mode-info h3 {
    color: #5a4a35;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.mode-info p {
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
}

.mode-info strong {
    color: #5a4a35;
}

.mode-info span {
    color: #2c1810;
    font-family: 'Courier New', monospace;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 30px;
    background: #d4c4a8;
    border: 2px solid #8b6f47;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b6f47 0%, #6d5438 100%);
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #2c1810;
    font-weight: bold;
    font-size: 1em;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #5a4a35;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    min-width: 120px;
}

.btn-primary {
    background: #7d9db5;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #6a8ca3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-success {
    background: #86a86f;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #739561;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-danger {
    background: #b57d7d;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #a36a6a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-info {
    background: #8b8b6f;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #767661;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.info-box {
    background: #e8dcc8;
    border: 2px solid #8b6f47;
    border-radius: 5px;
    padding: 15px;
    margin-top: 20px;
}

.info-box h4 {
    color: #5a4a35;
    margin-bottom: 10px;
}

.info-box ul {
    list-style-position: inside;
    color: #2c1810;
}

.info-box li {
    margin: 5px 0;
}

.decode-controls {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 20px;
}

.decode-status {
    background: #f9f6f0;
    border: 2px solid #8b6f47;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    font-weight: bold;
    color: #5a4a35;
}

footer {
    text-align: center;
    padding: 20px;
    color: #5a4a35;
    font-style: italic;
    border-top: 2px solid #8b6f47;
    margin-top: 30px;
}

/* 响应式设计 */
@media (max-width: 968px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .decode-controls {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    header h1 {
        font-size: 2em;
    }
}

@media (max-width: 600px) {
    .control-row {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.5em;
    }

    .tabs {
        flex-direction: column;
    }

    .tab {
        border-radius: 8px;
        border-bottom: 2px solid #8b6f47;
        margin-bottom: 5px;
    }

    .tab.active {
        margin-bottom: 5px;
    }
}