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

body {
    background: linear-gradient(145deg, #3c0b0b 0%, #701f1f 50%, #962b2b 100%);
    font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', Roboto, 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    color: #fef7e0;
    scroll-behavior: smooth;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #4a1414; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #f5bc70; border-radius: 10px; }

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 5%;
    backdrop-filter: blur(16px);
    background: rgba(30, 6, 6, 0.55);
    border-bottom: 1px solid rgba(255, 215, 0, 0.25);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
}
.logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFD966, #FFB347);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 2px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.logo span { font-size: 1.3rem; color: #ffd966; background: none; -webkit-background-clip: unset; background-clip: unset; }
.menu { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.menu a { text-decoration: none; color: #fff3db; font-weight: 500; transition: all 0.2s; border-bottom: 2px solid transparent; padding-bottom: 4px; }
.menu a:hover { color: #ffda88; border-bottom-color: #f5bc70; }

.hero { text-align: center; padding: 3rem 2rem 1.5rem; }
.hero h1 { font-size: 3.6rem; background: linear-gradient(120deg, #FFE6B0, #FFB347); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 1rem; letter-spacing: 2px; }
.hero p { font-size: 1.25rem; max-width: 800px; margin: 0 auto; opacity: 0.9; }

.card {
    background: rgba(45, 12, 12, 0.55);
    backdrop-filter: blur(12px);
    border-radius: 2rem;
    border: 1px solid rgba(255, 200, 100, 0.3);
    padding: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}
.card:hover { box-shadow: 0 20px 32px rgba(0, 0, 0, 0.4); }

.ai-container {
    max-width: 1300px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.form-group { margin-bottom: 1.6rem; }
.form-group label { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 0.5rem; color: #ffe1a0; }
input, select, textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 248, 225, 0.12);
    border: 1px solid rgba(255, 190, 80, 0.5);
    border-radius: 1.2rem;
    color: #fff5e6;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}
input:focus, select:focus, textarea:focus {
    border-color: #ffbc6e;
    background: rgba(70, 20, 20, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 180, 70, 0.3);
}
option { background: #3f1212; color: #fff0d4; }
.generate-btn {
    width: 100%;
    background: linear-gradient(95deg, #ffbc6e, #ff9f3d);
    border: none;
    padding: 1rem;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 3rem;
    color: #351010;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 1rem;
    box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}
.generate-btn:hover { transform: scale(1.01); background: linear-gradient(95deg, #ffcf7a, #ffb045); box-shadow: 0 12px 22px rgba(255,170,60,0.4); }
.generate-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.result-box { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.result-img-container {
    width: 100%;
    max-width: 350px;
    border-radius: 2rem;
    background: rgba(0,0,0,0.35);
    border: 2px dashed #ffc285;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.result-img-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: 0.2s;
    display: block;
}
.meaning-area {
    background: rgba(0,0,0,0.35);
    border-radius: 1.5rem;
    padding: 1.3rem;
    text-align: center;
    width: 100%;
    font-size: 1rem;
    line-height: 1.5;
    border-left: 4px solid #ffbc6e;
}

.info-section { max-width: 1300px; margin: 3rem auto; padding: 0 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 2rem; }
.badge { background: #ffb34720; border-radius: 30px; padding: 0.2rem 0.9rem; display: inline-block; font-size: 0.8rem; margin-bottom: 1rem; color: #ffd699; }
.section-title { font-size: 2rem; margin-bottom: 1rem; border-left: 6px solid #ffbc6e; padding-left: 1.2rem; font-weight: 700; }
.stat-grid { background: rgba(0,0,0,0.25); border-radius: 1.8rem; padding: 1.6rem; }

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.6rem;
    margin-top: 1.8rem;
}
.pattern-card-full {
    background: rgba(129, 46, 46, 0.4);
    backdrop-filter: blur(4px);
    border-radius: 1.6rem;
    padding: 1.3rem;
    border: 1px solid #e4a35a60;
    transition: transform 0.1s ease;
}
.pattern-card-full h4 { font-size: 1.4rem; color: #ffdf9c; margin-bottom: 0.6rem; display: flex; align-items: center; gap: 8px; }
.pattern-card-full p { font-size: 0.9rem; margin: 0.4rem 0; line-height: 1.4; }
.pattern-card-full small { color: #ffd7a0; opacity: 0.9; font-size: 0.8rem; }

.material-table {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border-radius: 1.6rem;
    overflow-x: auto;
    border-collapse: collapse;
    margin-top: 1.2rem;
}
.material-table th, .material-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,200,100,0.3);
    vertical-align: top;
}
.material-table th {
    background: rgba(255,190,80,0.2);
    font-weight: 700;
    color: #ffecb3;
}
.footer { text-align: center; padding: 2.5rem; background: #2b0a0ad9; margin-top: 3rem; font-size: 0.9rem; border-top: 1px solid #ffbc6e40; }

.stats-bar .stat-item { text-align: center; }
.stats-bar .stat-item strong {
    display: block;
    font-size: 1.5rem;
    color: #ffdf9c;
}
.stats-bar .stat-item span {
    font-size: 0.8rem;
    color: #ffd699cc;
}

/* ====== 手机响应式 ====== */
@media (max-width: 800px) {
    .ai-container { grid-template-columns: 1fr; padding: 0 1rem; }
    .hero h1 { font-size: 2.4rem; }
    .hero p { font-size: 1rem; padding: 0 1rem; }
    .navbar { flex-direction: column; gap: 12px; padding: 0.8rem 3%; }
    .logo { font-size: 1.5rem; }
    .logo span { font-size: 1rem; }
    .menu { gap: 0.6rem; font-size: 0.85rem; justify-content: center; }
    .menu a { padding-bottom: 2px; }
    .material-table th, .material-table td { padding: 0.7rem; font-size: 0.8rem; }
    .compare-container { grid-template-columns: 1fr; }
    .option-row { flex-direction: column; }
    .option-row .form-group { min-width: 100%; }
    .choice-btns { flex-direction: column; align-items: center; }
    .btn-like, .btn-regen { width: 90%; }
    .section-title { font-size: 1.5rem; }
    .card { padding: 1.2rem; border-radius: 1.5rem; }
    .stat-grid { padding: 1.2rem; }
    .modal-box { padding: 1.2rem; border-radius: 1.5rem; }
    .upload-area { height: 160px; }
    .footer { padding: 1.5rem 1rem; font-size: 0.8rem; }
}
@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .hero { padding: 2rem 1rem 1rem; }
    .tab-switch { flex-wrap: wrap; justify-content: center; width: 100%; }
    .tab-btn { padding: 0.5rem 1rem; font-size: 0.85rem; }
    .info-section { padding: 0 1rem; margin: 2rem auto; }
    .grid-3 { gap: 1rem; }
    .pattern-grid { gap: 1rem; }
    .navbar { padding: 0.6rem 2%; }
    .menu { gap: 0.4rem; font-size: 0.75rem; }
}
button { font-family: inherit; }
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 50%;
    border-top-color: #351010;
    animation: spin 0.8s ease infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.team-card h3 { font-size: 1.5rem; color: #ffdf9c; margin-bottom: 0.5rem; }
.team-card p { font-size: 0.95rem; margin: 0.3rem 0; color: #fce6b4; }
.team-card span { font-size: 0.8rem; opacity: 0.85; display: inline-block; margin-top: 6px; background: rgba(255,200,100,0.15); padding: 4px 10px; border-radius: 40px; }

/* Tab */
.tab-switch {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(0,0,0,0.25);
    padding: 0.4rem;
    border-radius: 3rem;
    width: fit-content;
}
.tab-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 3rem;
    border: none;
    background: transparent;
    color: #ffd699;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-weight: 500;
    white-space: nowrap;
}
.tab-btn.active {
    background: linear-gradient(95deg, #ffbc6e, #ff9f3d);
    color: #351010;
    font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 上传区域 */
.upload-area {
    width: 100%;
    height: 220px;
    border: 2px dashed rgba(255, 190, 80, 0.6);
    border-radius: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 248, 225, 0.05);
    position: relative;
    overflow: hidden;
}
.upload-area:hover {
    border-color: #ffbc6e;
    background: rgba(255, 190, 80, 0.1);
}
.upload-area.has-image {
    border-style: solid;
    border-color: #ffbc6e;
}
.upload-area.has-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 8px;
    display: block;
}
.upload-placeholder {
    text-align: center;
    pointer-events: none;
}
.upload-placeholder .icon { font-size: 3rem; margin-bottom: 0.5rem; }
.upload-placeholder p { font-size: 1rem; color: #ffd699; }
.upload-placeholder small { font-size: 0.8rem; color: #ffcc80aa; }
.upload-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    padding: 0.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #ffdf9c;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}
.upload-area.has-image:hover .upload-overlay { opacity: 1; }
.hidden-input { display: none; }

/* ====== 下载按钮 ====== */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(95deg, #66bb6a, #43a047);
    color: #fff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(67,160,71,0.3);
}
.download-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(67,160,71,0.5);
}
.download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ====== 下单按钮 ====== */
.order-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(95deg, #ff7043, #f4511e);
    color: #fff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.8rem;
    margin-left: 0.5rem;
    box-shadow: 0 4px 12px rgba(244,81,30,0.3);
}
.order-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(244,81,30,0.5);
}

/* ====== 下单弹窗 ====== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: linear-gradient(145deg, #3c0b0b, #701f1f);
    border: 1px solid rgba(255, 200, 100, 0.4);
    border-radius: 2rem;
    padding: 2rem;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative;
}
.modal-box h2 {
    color: #ffdf9c;
    margin-bottom: 1.5rem;
    text-align: center;
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: #ffd699;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #ffbc6e;
}
.modal-form .form-group {
    margin-bottom: 1.2rem;
}
.modal-form .form-group label {
    color: #ffe1a0;
    font-weight: 600;
    display: block;
    margin-bottom: 0.4rem;
}
.modal-form input,
.modal-form select,
.modal-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 248, 225, 0.12);
    border: 1px solid rgba(255, 190, 80, 0.5);
    border-radius: 1rem;
    color: #fff5e6;
    font-size: 0.95rem;
    outline: none;
}
.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
    border-color: #ffbc6e;
    background: rgba(70, 20, 20, 0.7);
}
.submit-order-btn {
    width: 100%;
    background: linear-gradient(95deg, #ff7043, #f4511e);
    border: none;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 3rem;
    color: #fff;
    cursor: pointer;
    margin-top: 0.5rem;
    box-shadow: 0 6px 14px rgba(244,81,30,0.3);
    transition: all 0.2s;
}
.submit-order-btn:hover {
    transform: scale(1.01);
    box-shadow: 0 10px 22px rgba(244,81,30,0.5);
}

/* ====== 生成后选项卡片 ====== */
.choice-card {
    background: rgba(255, 180, 70, 0.1);
    border: 1px solid rgba(255, 190, 80, 0.4);
    border-radius: 1.5rem;
    padding: 1.5rem;
    text-align: center;
    margin-top: 1rem;
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.choice-card h3 { color: #ffdf9c; margin-bottom: 0.8rem; font-size: 1.2rem; }
.choice-card p { color: #ffd699cc; font-size: 0.9rem; margin-bottom: 1rem; }
.choice-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn-like {
    background: linear-gradient(95deg, #ff7043, #f4511e);
    color: #fff;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 3rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(244,81,30,0.3);
}
.btn-like:hover { transform: scale(1.03); box-shadow: 0 6px 18px rgba(244,81,30,0.5); }

.btn-regen {
    background: rgba(255,248,225,0.1);
    color: #ffd699;
    border: 1px solid rgba(255,190,80,0.4);
    padding: 0.8rem 2rem;
    border-radius: 3rem;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-regen:hover { background: rgba(255,190,80,0.2); border-color: #ffbc6e; }

/* ====== 定制选项面板 ====== */
.customize-panel {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255, 190, 80, 0.35);
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-top: 1rem;
    animation: fadeIn 0.4s ease;
}
.customize-panel h3 {
    color: #ffdf9c;
    text-align: center;
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
}
.option-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.option-row .form-group { flex: 1; min-width: 140px; margin-bottom: 0; }
.price-tag {
    background: rgba(255, 180, 70, 0.15);
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    margin: 1rem 0;
    border: 1px dashed rgba(255,190,80,0.4);
}
.price-tag strong { color: #ffdf9c; font-size: 1.3rem; }
.price-tag span { color: #ffd699; font-size: 0.85rem; }

/* ====== 订单确认页面 ====== */
.order-confirm {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(102, 187, 106, 0.4);
    border-radius: 1.5rem;
    padding: 1.8rem;
    margin-top: 1rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
}
.order-confirm h3 { color: #66bb6a; font-size: 1.4rem; margin-bottom: 1rem; }
.order-confirm .order-detail {
    background: rgba(0,0,0,0.2);
    border-radius: 1rem;
    padding: 1rem;
    margin: 1rem 0;
    text-align: left;
}
.order-confirm .order-detail p { margin: 0.4rem 0; font-size: 0.9rem; color: #ffd699; }
.order-confirm .order-detail strong { color: #ffdf9c; }

.order-success {
    text-align: center;
    padding: 2rem 1rem;
    display: none;
}
.order-success h3 {
    color: #66bb6a;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.order-success p {
    color: #ffd699;
    line-height: 1.6;
}

/* ====== 状态横幅 ====== */
.status-banner-inner {
    text-align: center;
    padding: 0.8rem 1.5rem;
    border-radius: 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    animation: fadeIn 0.3s ease;
}
.status-banner-inner.generating {
    background: rgba(255, 180, 70, 0.2);
    border: 1px solid rgba(255, 190, 80, 0.5);
    color: #ffdf9c;
}
.status-banner-inner.recovering {
    background: rgba(102, 187, 106, 0.2);
    border: 1px solid rgba(102, 187, 106, 0.5);
    color: #a5d6a7;
}
.status-banner-inner.completed {
    background: rgba(102, 187, 106, 0.15);
    border: 1px solid rgba(102, 187, 106, 0.35);
    color: #81c784;
}
