:root {
    --bg-dark: #0b0b10;
    --bg-card: rgba(23, 23, 30, 0.7);
    --primary-cyan: #00f2ff;
    --primary-purple: #bc00dd;
    --text-main: #ffffff;
    --text-muted: #8b8b9e;
    --border-glow: 0 0 10px rgba(0, 242, 255, 0.3);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

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

html, body {
    overflow-x: hidden; /* 禁止横向滚动 */
    width: 100%;
    max-width: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(188, 0, 221, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 242, 255, 0.15) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    padding: 20px;
}

/* 背景网格动画 */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 50px;
    padding-top: 30px;
}

.logo h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 8vw, 64px); /* 响应式字体大小 */
    letter-spacing: 4px;
    margin: 10px 0;
    text-shadow: 0 0 20px rgba(0, 242, 255, 0.5);
}

.logo-icon {
    font-size: 40px;
}

.highlight {
    color: var(--primary-cyan);
}

.tagline {
    font-size: 16px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sub-tag {
    color: var(--primary-purple);
    font-weight: bold;
}

/* 玻璃拟态卡片 */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-purple), var(--primary-cyan));
}

/* 标题样式 */
.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.card-header.sm {
    margin-top: 30px;
    margin-bottom: 15px;
}

.step-badge {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-cyan));
    color: #000;
    font-weight: bold;
    font-family: var(--font-display);
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 15px;
    font-size: 14px;
}

h2, h3 {
    font-family: var(--font-display);
    font-weight: normal;
    letter-spacing: 1px;
    color: var(--text-main);
}

h2 { font-size: clamp(18px, 5vw, 24px); }
h3 { font-size: 18px; color: var(--text-muted); }

/* 上传区域 */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    width: 100%;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-cyan);
    background: rgba(0, 242, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(0, 242, 255, 0.1);
}

.icon-box {
    font-size: 48px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.upload-area:hover .icon-box {
    transform: scale(1.1);
}

.upload-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-cyan);
    opacity: 0;
    box-shadow: 0 0 10px var(--primary-cyan);
    pointer-events: none;
}

.upload-area:hover .scan-line {
    opacity: 0.8;
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    object-fit: contain;
}

.reupload-btn {
    margin-top: 15px;
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.reupload-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

/* 输入框样式 */
.textarea-wrapper {
    position: relative;
    padding: 2px;
}

textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 15px;
    font-family: var(--font-body);
    font-size: 16px;
    border-radius: 4px;
    resize: vertical;
    transition: all 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    background: rgba(188, 0, 221, 0.05);
    box-shadow: 0 0 15px rgba(188, 0, 221, 0.1);
}

/* 生成按钮 */
.generate-btn {
    width: 100%;
    margin-top: 40px;
    padding: 20px;
    background: linear-gradient(90deg, var(--primary-purple), #7000ff);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: var(--font-display);
    font-size: clamp(16px, 4vw, 20px);
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    text-transform: uppercase;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(188, 0, 221, 0.6);
}

.generate-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

/* 加载状态 */
.loading-card {
    text-align: center;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.scanner-container {
    position: relative;
    width: 80px;
    height: 50px;
    margin-bottom: 20px;
}

.scanner-car {
    font-size: 50px;
    filter: drop-shadow(0 0 10px var(--primary-cyan));
}

.scanner-beam {
    position: absolute;
    top: 0;
    left: -20%;
    width: 140%;
    height: 4px;
    background: var(--primary-cyan);
    box-shadow: 0 0 15px var(--primary-cyan);
    animation: scanning 2s ease-in-out infinite alternate;
}

@keyframes scanning {
    0% { top: 0; opacity: 0.5; }
    100% { top: 100%; opacity: 1; }
}

.terminal-output {
    font-family: 'Courier New', monospace;
    color: var(--primary-cyan);
    text-align: left;
    width: 90%;
    max-width: 400px;
    height: 80px;
    margin: 20px 0;
    overflow: hidden;
    font-size: 14px;
}

.loading-progress-container {
    width: 90%;
    max-width: 400px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-cyan);
    width: 0%;
    box-shadow: 0 0 10px var(--primary-cyan);
    transition: width 0.3s ease;
}

/* 结果展示容器 */
.result-display-container {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.1);
    min-height: 200px;
    background: #000;
}

.result-img {
    display: block;
    width: 100%;
    height: auto;
    display: block;
}

/* 按钮组 */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.action-btn {
    padding: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: white;
    text-decoration: none;
    text-align: center;
    font-family: var(--font-display);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 6px;
}

.download-btn {
    background: rgba(0, 242, 255, 0.1);
    border-color: var(--primary-cyan);
}

.download-btn:hover {
    background: var(--primary-cyan);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
}

.restart-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px 0;
}

/* 密码验证弹窗 */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 25px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text-main);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-close:hover {
    color: var(--text-main);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
}

.modal-hint {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 14px;
}

.password-input {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 24px;
    font-family: var(--font-display);
    letter-spacing: 8px;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.3s;
}

.password-input:focus {
    outline: none;
    border-color: var(--primary-cyan);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
}

.modal-wechat {
    margin-top: 20px;
    padding: 15px;
    background: rgba(188, 0, 221, 0.1);
    border: 1px solid rgba(188, 0, 221, 0.3);
    border-radius: 8px;
    text-align: center;
}

.wechat-hint {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.wechat-id {
    color: var(--primary-purple);
    font-size: 20px;
    font-weight: bold;
    font-family: var(--font-display);
    margin: 8px 0;
    letter-spacing: 2px;
}

.wechat-note {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.8;
}

.modal-error {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 6px;
    color: #ff6b6b;
    font-size: 14px;
    text-align: center;
}

.modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 15px 25px 25px;
}

.modal-btn {
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

.confirm-btn {
    background: linear-gradient(90deg, var(--primary-purple), #7000ff);
    color: white;
}

.confirm-btn:hover {
    box-shadow: 0 0 20px rgba(188, 0, 221, 0.5);
    transform: translateY(-2px);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .container { padding: 0 10px; }
    .glass-card { padding: 20px; }
    .action-buttons { grid-template-columns: 1fr; }
    .logo h1 { font-size: 42px; }
    
    /* 修复移动端可能的溢出 */
    textarea { font-size: 14px; }
    .upload-title { font-size: 16px; }
}
