@font-face {
    font-family: 'WeChatSansStd';
    src: url('../fonts/WeChatSansSS-Medium.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'WeChatSansStd';
    src: url('../fonts/WeChatSansSS-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'WeChatSansStd';
    src: url('../fonts/WeChat-Sans-Std-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Helvetica Neue Bd';
    src: url('../fonts/HelveticaNeueLTStd-Bd.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Helvetica Neue Bd';
    src: url('../fonts/HelveticaNeueLTStd-Bd.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Helvetica Neue Md';
    src: url('../fonts/HelveticaNeueLTStd-Md.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Helvetica Neue Md';
    src: url('../fonts/HelveticaNeueLTStd-Md.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Prequel Light';
    src: url('../fonts/Prequel-Light.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Prequel Light';
    src: url('../fonts/Prequel-Light.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'San Francisco';
    src: url('../fonts/SF-Pro-Display-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'San Francisco';
    src: url('../fonts/SF-Pro-Display-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #f3f4f6;
    --sidebar-bg: #1f2937;
    --sidebar-text: #f9fafb;
    --sidebar-hover: #374151;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.layout {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 20px;
    font-size: 1.25rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.menu {
    list-style: none;
    padding: 10px 0;
}

.menu-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background-color: var(--sidebar-hover);
}

.menu-item.active {
    background-color: var(--primary-color);
    font-weight: 500;
}

/* Console Area */
.console {
    flex: 1;
    display: flex;
    padding: 20px;
    gap: 20px;
    overflow-y: auto;
}

.form-area {
    flex: 1;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

.preview-area {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 24px;
}

/* Upload */
.upload-container {
    margin-bottom: 30px;
}

.btn-upload {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    color: #475569;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #eff6ff;
}

/* Settings */
.settings {
    margin-bottom: 30px;
}

.settings h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.form-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.form-group label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-group input {
    width: 100px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
}

/* Primary Button */
.btn-primary {
    margin-top: auto;
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.btn-primary:disabled {
    background-color: #93c5fd;
    cursor: not-allowed;
}

/* Preview Canvas */
.preview-card {
    display: flex;
    flex-direction: column;
}

.canvas-container {
    flex: 1;
    background-color: #f1f5f9;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
}

/* Password Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.modal-content input[type="password"] {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
    outline: none;
}

.modal-content input[type="password"]:focus {
    border-color: var(--primary-color);
}

.modal-content .btn-primary {
    width: 100%;
    padding: 10px;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    height: 1.2rem; /* Reserve space for message */
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 900px) {
    .console {
        flex-direction: column;
    }
    .form-area {
        max-width: 100%;
        height: auto;
    }
    .preview-area {
        height: 600px;
    }
}
