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

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --secondary: #00c6ff;
    --accent: #7c3aed;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 20px rgba(26, 115, 232, 0.15);
    --shadow-lg: 0 10px 40px rgba(26, 115, 232, 0.2);
    --radius: 16px;
    --radius-sm: 10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 40px;
}

/* 可移动按钮 */
.cs-btn, .query-btn {
    position: fixed;
    z-index: 1000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 11px;
    font-weight: 600;
    color: white;
    border: 3px solid rgba(255,255,255,0.3);
}

.cs-btn {
    right: 20px;
    top: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.query-btn {
    left: 20px;
    top: 60%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
}

.cs-btn:active, .query-btn:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.cs-icon, .query-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--card-bg);
    margin: 15% auto;
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s;
    position: relative;
}

.modal-content.success {
    text-align: center;
}

.close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
}

.close:hover { color: var(--text); }

/* 容器 */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    margin-bottom: 25px;
    color: white;
    box-shadow: var(--shadow);
}

.logo {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
}

/* 区块 */
.section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

/* 模板网格 */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.template-card {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.template-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 5px 20px rgba(26,115,232,0.2);
}

.template-img {
    width: 60px;
    height: 60px;
    margin: 0 auto 8px;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-placeholder {
    font-size: 28px;
}

.template-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.template-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 教程内容 */
.intro-content {
    background: var(--primary-light);
    padding: 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 2;
    color: var(--text);
}

/* 素材区 */
.material-box {
    text-align: center;
}

.material-box img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.save-btn, .copy-btn-large {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.save-btn {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: white;
}

.copy-btn-large {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    margin-top: 10px;
}

.save-btn:hover, .copy-btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

/* 文案区 */
.text-box textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    resize: vertical;
    background: #f8fafc;
    color: var(--text);
    line-height: 1.8;
}

/* 表单 */
.form-group {
    margin-bottom: 18px;
}

.form-group.required label {
    font-weight: 700;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.required-mark {
    color: var(--danger);
    font-weight: 700;
}

.hint {
    font-weight: normal;
    color: var(--text-secondary);
    font-size: 12px;
}

.form-group input[type="text"],
.form-group input[type="url"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: border-color 0.3s;
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* 上传框 */
.upload-box {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8fafc;
}

.upload-box:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-box.has-file {
    border-color: var(--success);
    background: #f0fdf4;
}

.upload-box input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder span {
    font-size: 36px;
}

.upload-placeholder p {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 14px;
}

.upload-hint {
    color: var(--danger) !important;
    font-size: 12px !important;
    margin-top: 5px;
}

#qrPreview {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    margin-top: 10px;
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(26,115,232,0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(26,115,232,0.4);
}

/* 成功弹窗 */
.success-icon {
    font-size: 60px;
    margin-bottom: 10px;
}

.order-no-box {
    background: var(--primary-light);
    padding: 15px;
    border-radius: var(--radius-sm);
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.order-no-box span {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    font-family: monospace;
    letter-spacing: 1px;
}

.order-no-box button {
    padding: 6px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.confirm-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
}

/* 客服弹窗 */
.cs-info p {
    padding: 12px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.copy-btn {
    padding: 5px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

/* 查询弹窗 */
.query-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.query-form input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
}

.query-form button {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
}

#queryResult {
    padding: 15px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 响应式 */
@media (max-width: 480px) {
    .container { padding: 10px; }
    .section { padding: 18px; }
    .template-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .cs-btn, .query-btn { width: 55px; height: 55px; font-size: 10px; }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 3000;
    animation: fadeIn 0.3s;
}
