/* ============================================================
   建筑效果图提示词生成器 — 亮化柔和玻璃拟态（Soft Glassmorphism）
   设计规范：玻璃拟态通用设计Prompt（浅色系+高科技光效）
   契约：所有 class/ID 钩子与 JS 函数名保持不变，仅替换视觉表现
   ============================================================ */

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

:root {
    --g1: #00c2ff;   /* 青 */
    --g2: #3d7bff;   /* 蓝 */
    --g3: #8b5cf6;   /* 紫 */
    --grad: linear-gradient(120deg, var(--g1), var(--g2) 52%, var(--g3));
    --text: #1c2b45;
    --text-2: #5a6b8c;
    --text-3: #7c8cab;
    --glass: rgba(255, 255, 255, .52);
    --glass-border: rgba(255, 255, 255, .9);
    --glass-blur: blur(22px) saturate(160%);
    --shadow: 0 8px 24px -10px rgba(80, 110, 220, .35);
    --shadow-lg: 0 18px 50px -18px rgba(80, 110, 220, .45);
    --radius: 20px;
    --radius-sm: 12px;
    --focus-glow: 0 0 0 4px rgba(0, 194, 255, .18);
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    background: linear-gradient(135deg, #cadfff, #e7edff 45%, #f4f0ff);
    background-attachment: fixed;
}

::selection { background: rgba(0, 194, 255, .3); }

/* 自定义滚动条：青紫渐变圆角滑块 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--g1), var(--g3));
    border-radius: 8px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 背景系统（固定定位，最底层：网格+光斑+粒子+顶部辉映） ===== */
.bg-system {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(90, 120, 255, .10) 1px, transparent 1px),
        linear-gradient(90deg, rgba(90, 120, 255, .10) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 30%, transparent 75%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    will-change: transform;
}

.blob-1 {
    width: 560px; height: 560px;
    background: #7fb2ff;
    top: -160px; left: -120px;
    opacity: .5;
    animation: blobFloat 16s ease-in-out infinite;
}

.blob-2 {
    width: 480px; height: 480px;
    background: #b18cff;
    top: -120px; right: -100px;
    opacity: .45;
    animation: blobFloat 16s ease-in-out -5.3s infinite;
}

.blob-3 {
    width: 420px; height: 420px;
    background: linear-gradient(135deg, #7ce0ff, #ff9ad0);
    bottom: -120px; left: -80px;
    opacity: .4;
    animation: blobFloat 16s ease-in-out -10.6s infinite;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(40px, 30px) scale(1.06); }
    50%  { transform: translate(-30px, 50px) scale(.97); }
    75%  { transform: translate(30px, -20px) scale(1.04); }
}

.bg-toplight {
    position: absolute;
    inset: 0 0 auto 0;
    height: 420px;
    background: radial-gradient(ellipse 70% 100% at 50% 0%, rgba(255, 255, 255, .85), transparent 70%);
}

#bg-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ===== 顶部导航（sticky 玻璃深卡） ===== */
.header {
    position: sticky;
    top: 14px;
    z-index: 100;
    padding: 0 20px;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    max-width: 1400px;
    background: rgba(255, 255, 255, .34);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 12px 22px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--grad);
    background-size: 160% 160%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 8px 20px -6px rgba(61, 123, 255, .6), inset 0 0 14px rgba(255, 255, 255, .35);
}

.logo-text strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
}

.logo-text small {
    display: block;
    font-size: 11px;
    color: var(--text-3);
    letter-spacing: .4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.nav-item:hover {
    color: var(--g2);
    border-color: rgba(61, 123, 255, .45);
    background: rgba(255, 255, 255, .5);
}

.nav-item.active {
    background: var(--grad);
    background-size: 160% 160%;
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(61, 123, 255, .7);
}

.model-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-2);
    background: rgba(255, 255, 255, .5);
    border: 1px solid rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.chip .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, .9);
    animation: dotBreath 2.4s ease-in-out infinite;
}

@keyframes dotBreath {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}

/* ===== 主内容区 ===== */
.main-content {
    padding: 26px 0 40px;
}

/* ===== 面板切换 ===== */
.tab-panel {
    display: none;
    animation: fadeInUp 0.55s cubic-bezier(.2, .7, .2, 1);
}

.tab-panel.active {
    display: block;
}

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

/* ===== 网格布局 ===== */
.panel-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

/* ===== 玻璃卡片 ===== */
.card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    animation: fadeInUp 0.55s cubic-bezier(.2, .7, .2, 1) both;
}

.panel-left .card:nth-child(1) { animation-delay: .05s; }
.panel-left .card:nth-child(2) { animation-delay: .13s; }
.panel-left .card:nth-child(3) { animation-delay: .21s; }

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.card-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .65);
    border: 1px solid rgba(255, 255, 255, .95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    box-shadow: 0 4px 12px -4px rgba(80, 110, 220, .35);
}

.card-desc {
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ===== 表单元素 ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 6px;
}

.form-select,
.form-textarea,
.prompt-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(140, 165, 220, .35);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, .6);
    transition: all 0.2s;
    font-family: inherit;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6b8c' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
}

.form-select:focus,
.form-textarea:focus,
.prompt-textarea:focus {
    outline: none;
    border-color: var(--g1);
    box-shadow: var(--focus-glow);
    background: rgba(255, 255, 255, .8);
}

.form-textarea {
    padding: 12px 14px;
    resize: vertical;
    min-height: 80px;
}

/* ===== 按钮体系 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

.btn-primary {
    background: var(--grad);
    background-size: 160% 160%;
    background-position: 0% 50%;
    color: #fff;
    box-shadow: 0 10px 22px -10px rgba(61, 123, 255, .7);
}

.btn-primary:hover {
    background-position: 100% 50%;
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, .55);
    color: var(--g2);
    border: 1px solid rgba(61, 123, 255, .45);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, .85);
    box-shadow: 0 6px 16px -8px rgba(61, 123, 255, .55);
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    background: rgba(255, 255, 255, .5);
    border: 1px solid rgba(255, 255, 255, .9);
    color: var(--text-2);
    cursor: pointer;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: var(--g2);
    border-color: rgba(61, 123, 255, .45);
    box-shadow: 0 4px 14px -6px rgba(61, 123, 255, .55);
}

/* 按钮内小加载环 */
.btn-spin {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* ===== 结果卡片 ===== */
.result-card {
    min-height: 500px;
    position: sticky;
    top: 92px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(140, 165, 220, .25);
}

.card-actions {
    display: flex;
    gap: 6px;
}

.result-content {
    min-height: 300px;
}

/* ===== 空状态 ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-3);
    text-align: center;
}

.empty-state .empty-icon {
    font-size: 44px;
    margin-bottom: 16px;
    opacity: .75;
}

.empty-state p {
    font-size: 14px;
}

/* ===== 结果展示 ===== */
.result-block {
    margin-bottom: 24px;
}

.result-block h4 {
    font-size: 13px;
    color: var(--text-2);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.prompt-text {
    background: rgba(255, 255, 255, .55);
    border: 1px solid rgba(140, 165, 220, .28);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 14px;
    line-height: 1.9;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

/* 提示词可编辑文本框（英文/中文） */
textarea.prompt-text {
    display: block;
    width: 100%;
    resize: vertical;
    min-height: 110px;
    font-family: inherit;
}

textarea.prompt-text:focus {
    outline: none;
    border-color: var(--g1);
    box-shadow: var(--focus-glow);
    background: rgba(255, 255, 255, .8);
}

/* 中英互译同步状态提示 */
.sync-status {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-3);
    margin-left: 6px;
}

.sync-status.ok { color: #10b981; }
.sync-status.err { color: #ef4444; }

.prompt-text.cn {
    background: rgba(224, 247, 250, .55);
    border-color: rgba(0, 194, 255, .3);
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--grad);
    background-size: 200% 200%;
    color: white;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 4px 10px -4px rgba(61, 123, 255, .6);
}

.tips-box {
    background: rgba(255, 244, 214, .65);
    border: 1px solid rgba(245, 185, 66, .4);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 13px;
    color: #8a5a00;
}

.tips-box strong {
    display: block;
    margin-bottom: 6px;
}

/* ===== AI 效果图渲染 ===== */
.render-block {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px dashed rgba(140, 165, 220, .45);
}

.render-prompt {
    min-height: 70px;
    font-size: 13px;
}

.render-options {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-top: 12px;
    flex-wrap: wrap;
}

.render-option {
    flex: 1;
    min-width: 140px;
}

.render-option label {
    display: block;
    font-size: 12px;
    color: var(--text-2);
    margin-bottom: 4px;
}

.render-options .btn {
    white-space: nowrap;
}

#render-output {
    margin-top: 16px;
}

.render-empty {
    border: 1px dashed rgba(140, 165, 220, .5);
    border-radius: var(--radius-sm);
    padding: 32px 20px;
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
    background: rgba(255, 255, 255, .35);
}

.render-image {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: var(--shadow);
    display: block;
}

.render-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.render-actions .btn {
    flex: 1;
    text-decoration: none;
}

.render-meta {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-3);
    text-align: center;
}

.render-revised {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-2);
    background: rgba(255, 255, 255, .45);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    line-height: 1.7;
}

.render-revised strong {
    color: var(--text);
}

/* ===== 快捷模板网格 ===== */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.template-card {
    background: rgba(255, 255, 255, .45);
    border: 1px solid rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: rgba(61, 123, 255, .55);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.template-card .icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.template-card h4 {
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text);
}

.template-card .meta {
    font-size: 12px;
    color: var(--text-3);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.template-card .meta span {
    background: rgba(255, 255, 255, .6);
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(140, 165, 220, .3);
}

.template-card .action-btn {
    margin-top: 12px;
    padding: 8px;
    background: var(--grad);
    background-size: 160% 160%;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.template-card .action-btn:hover {
    background-position: 100% 50%;
    box-shadow: 0 8px 18px -8px rgba(61, 123, 255, .7);
}

/* ===== 历史记录 ===== */
.history-list {
    max-height: 600px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px dashed rgba(140, 165, 220, .35);
    cursor: pointer;
    transition: background 0.2s;
    border-radius: var(--radius-sm);
}

.history-item:hover {
    background: rgba(255, 255, 255, .5);
}

.history-item .info h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.history-item .info p {
    font-size: 12px;
    color: var(--text-3);
}

.history-item .actions {
    display: flex;
    gap: 8px;
}

.history-item .actions button {
    padding: 6px 12px;
    font-size: 12px;
    font-family: inherit;
    border: 1px solid rgba(140, 165, 220, .4);
    background: rgba(255, 255, 255, .55);
    color: var(--text-2);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item .actions button:hover {
    background: var(--grad);
    color: white;
    border-color: transparent;
}

/* ===== 弹窗（玻璃对话框） ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 45, 90, .35);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    backdrop-filter: blur(30px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: var(--radius);
    width: 90%;
    max-width: min(700px, 94vw);
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.3s cubic-bezier(.2, .7, .2, 1);
    display: flex;
    flex-direction: column;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(.94); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(140, 165, 220, .3);
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-3);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 50vh;
}

.prompt-section {
    margin-bottom: 20px;
}

.prompt-section label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
}

.prompt-textarea {
    min-height: 120px;
    padding: 14px;
    line-height: 1.8;
    resize: vertical;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid rgba(140, 165, 220, .3);
    background: rgba(255, 255, 255, .35);
}

/* ===== 加载动画 ===== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-3);
}

.loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(120, 150, 255, .2);
    border-top-color: var(--g2);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    color: var(--text);
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, .95);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: toastIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success { border-left: 4px solid #10b981; }
.toast.error { border-left: 4px solid #ef4444; }

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

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .result-card {
        position: static;
    }
}

@media (max-width: 760px) {
    .header {
        padding: 0 12px;
    }

    .header .container {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .logo {
        justify-content: center;
    }

    .header-right {
        justify-content: center;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .model-chips {
        justify-content: center;
    }

    .template-grid {
        grid-template-columns: 1fr;
    }
}
