/* 短链生成器 - 首页样式 (2026-11) */
:root {
    --primary: #0fb5a0;
    --primary-dark: #0a9684;
    --primary-soft: #e7f8f5;
    --text: #1f2a37;
    --muted: #6b7684;
    --line: #e7ebf0;
    --bg: #f5f7fa;
    --card: #ffffff;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    background-image: radial-gradient(1200px 420px at 50% -120px, #dff6f1 0%, rgba(223, 246, 241, 0) 70%);
    background-repeat: no-repeat;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- 导航 ---------- */
.topnav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: 60px;
    padding: 0 max(24px, calc((100% - 1160px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid rgba(231, 235, 240, .8);
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-icon { width: 32px; height: 32px; border-radius: 8px; overflow: hidden; flex: none; }
.logo-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-text { font-size: 17px; font-weight: 650; letter-spacing: .3px; }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a, .nav-logout {
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color .2s;
}
.nav-links a:hover, .nav-logout:hover { color: var(--primary); }
.nav-form { margin: 0; display: inline-flex; }
.nav-logout { border: 0; background: none; padding: 0; }
.nav-user { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.nav-user i { color: #b5bec9; font-size: 16px; }
.nav-links a.nav-cta {
    color: #fff;
    background: var(--primary);
    padding: 7px 16px;
    border-radius: 999px;
}
.nav-links a.nav-cta:hover { background: var(--primary-dark); color: #fff; }

.menu-btn {
    display: none;
    width: 38px; height: 38px;
    border: 0; border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 18px;
}
.menu-btn:active { background: var(--bg); }

.mobile-menu {
    display: none;
    position: fixed;
    top: 60px; left: 0; right: 0;
    z-index: 999;
    background: #fff;
    padding: 8px 12px 12px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(16, 24, 40, .08);
}
.mobile-menu.show { display: block; animation: menuIn .2s ease; }
.mobile-menu form { margin: 0; }
.mobile-menu a, .mobile-menu button {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 13px 14px;
    border: 0; border-radius: 10px;
    background: none;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    text-align: left;
}
.mobile-menu i { width: 18px; text-align: center; color: var(--muted); }
.mobile-menu a:active, .mobile-menu button:active { background: var(--primary-soft); color: var(--primary-dark); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- 标题区 ---------- */
.hero {
    max-width: 1160px;
    margin: 0 auto;
    padding: 108px 24px 32px;
    text-align: center;
}
.hero h1 {
    font-size: 36px;
    line-height: 1.25;
    font-weight: 750;
    letter-spacing: .5px;
}
.hero h1 span {
    background: linear-gradient(90deg, #0fb5a0, #3aa0e0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p { margin-top: 12px; color: var(--muted); font-size: 16px; }

/* ---------- 主体 ---------- */
.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}

.input-section, .preview-section {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.input-section { display: flex; flex-direction: column; min-height: 500px; overflow: hidden; }

.toolbar {
    display: flex;
    gap: 4px;
    margin: 16px 20px 0;
    padding: 4px;
    background: var(--bg);
    border-radius: 12px;
    align-self: flex-start;
}
.tool-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 18px;
    border: 0; border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 14px; font-weight: 500;
    white-space: nowrap;
    transition: all .2s;
}
.tool-btn i { font-size: 13px; }
.tool-btn:hover { color: var(--text); }
.tool-btn.active { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }

.input-content { flex: 1; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 16px; }

.text-area, .text-ai {
    width: 100%;
    flex: 1;
    min-height: 340px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfd;
    font-size: 15px;
    line-height: 1.7;
    resize: none;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.text-area::placeholder, .text-ai::placeholder, .title-input::placeholder { color: #a3acb8; }
.text-area:focus, .text-ai:focus, .title-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 181, 160, .12);
}
.batch-area { font-family: ui-monospace, SFMono-Regular, Consolas, "Microsoft YaHei", monospace; font-size: 14px; }

.batch-controls {
    margin-top: 12px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    color: var(--muted); font-size: 13px;
}
.batch-controls i { color: var(--primary); }

.ghost-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--line); border-radius: 9px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    transition: all .2s;
}
.ghost-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.ghost-btn:disabled { opacity: .6; cursor: wait; }

.generate-btn, .apply-settings, .primary-btn {
    width: 100%;
    height: 48px;
    border: 0; border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 16px; font-weight: 600; letter-spacing: 2px;
    transition: background .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 6px 16px rgba(15, 181, 160, .25);
}
.generate-btn:hover:not(:disabled), .apply-settings:hover, .primary-btn:hover { background: var(--primary-dark); }
.generate-btn:active:not(:disabled), .apply-settings:active, .primary-btn:active { transform: scale(.99); }
.generate-btn:disabled { background: #cfd6de; box-shadow: none; cursor: not-allowed; }
.primary-btn { letter-spacing: 0; font-size: 15px; }

/* 上传区域（保留功能） */
.title-input-wrapper { position: relative; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.title-input {
    flex: 1; height: 42px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 10px; outline: none; background: #fbfcfd;
}
.title-help { color: #a3acb8; cursor: pointer; }
.title-tooltip {
    display: none; position: absolute; top: 48px; right: 0; z-index: 10;
    width: 240px; padding: 12px; border-radius: 10px;
    background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line);
    font-size: 13px; color: var(--muted);
}
.title-tooltip.show { display: block; }
.upload-area {
    height: 260px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    border: 2px dashed var(--line); border-radius: 12px; background: #fbfcfd;
    cursor: pointer; transition: all .2s;
}
.upload-area:hover, .upload-area.highlight { border-color: var(--primary); background: var(--primary-soft); }
.upload-icon { font-size: 40px; color: var(--primary); }
.upload-text { font-size: 15px; }
.upload-hint { font-size: 13px; color: var(--muted); }
.file-preview { background: var(--bg); border-radius: 12px; padding: 12px; cursor: pointer; }
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; }
.remove-file { border: 0; background: none; color: var(--muted); padding: 4px 8px; }
.remove-file:hover { color: #e5484d; }
#image-preview { width: 100%; max-height: 200px; object-fit: contain; border-radius: 8px; }
#video-preview, #audio-preview { width: 100%; border-radius: 8px; }

/* ---------- 预览区 ---------- */
.preview-section {
    padding: 28px 24px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    min-height: 500px;
}

.qr-container {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
    border-radius: 16px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        repeating-linear-gradient(45deg, #f3f5f8 0 10px, #fafbfc 10px 20px) border-box;
    border: 1px solid var(--line);
    overflow: hidden;
    position: relative;
}
.qr-container:empty {
    background: repeating-linear-gradient(45deg, #f6f8fa 0 10px, #fbfcfd 10px 20px);
    border: 1px dashed #d5dbe3;
}
.qr-container:empty::before {
    content: "\f029";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 56px;
    color: #d3dae2;
}
.qr-container:empty::after {
    content: "二维码将在这里显示";
    position: absolute;
    bottom: 22%;
    font-size: 13px;
    color: #a3acb8;
}
.qr-container img {
    width: 100%; height: 100%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    animation: qrIn .35s ease;
}
@keyframes qrIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.button-group {
    width: 100%; max-width: 320px;
    display: flex; align-items: center; gap: 8px;
}
.download-btn {
    flex: 1;
    height: 42px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--line); border-radius: 10px;
    background: #fff;
    color: #b0b8c3;
    font-size: 14px; font-weight: 500;
    cursor: not-allowed;
    transition: all .2s;
}
.download-btn i { font-size: 13px; }
.download-btn.active { color: var(--primary-dark); border-color: rgba(15, 181, 160, .45); cursor: pointer; }
.download-btn.active:hover { background: var(--primary-soft); border-color: var(--primary); }

.settings-btn {
    width: 42px; height: 42px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--muted);
    transition: all .2s;
}
.settings-btn:hover { color: var(--primary-dark); border-color: var(--primary); background: var(--primary-soft); }

/* 短链接展示 */
.link-display {
    width: 100%; max-width: 320px;
    display: flex; align-items: flex-end; gap: 8px;
    padding: 12px;
    border-radius: 12px;
    background: var(--primary-soft);
    animation: qrIn .3s ease;
}
.link-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.link-label { font-size: 12px; color: var(--primary-dark); font-weight: 600; }
.short-link-input {
    width: 100%; height: 36px; padding: 0 10px;
    border: 1px solid rgba(15, 181, 160, .25); border-radius: 8px;
    background: #fff;
    font-size: 14px;
    outline: none;
    text-overflow: ellipsis;
}
.copy-link-btn {
    height: 36px; padding: 0 14px; flex: none;
    display: inline-flex; align-items: center; gap: 6px;
    border: 0; border-radius: 8px;
    background: var(--primary); color: #fff;
    font-size: 14px; font-weight: 500;
    transition: background .2s;
}
.copy-link-btn:hover { background: var(--primary-dark); }
.copy-link-btn.copied { background: #16a34a; }

/* 批量进度 */
.batch-preview { width: 100%; flex-direction: column; align-items: stretch; justify-content: center; gap: 16px; }
.batch-progress-container { width: 100%; }
.batch-status { margin-bottom: 12px; font-size: 15px; font-weight: 600; text-align: center; }
.progress-bar-bg { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; margin-bottom: 14px; }
.progress-bar-fill { width: 0; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0fb5a0, #3aa0e0); transition: width .3s; }
.batch-log {
    height: 240px; overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 10px;
    background: #fbfcfd;
    font-size: 13px; color: var(--muted);
}
.batch-log p { padding: 3px 0; word-break: break-all; border-bottom: 1px dashed #eef1f4; }
.batch-log p:last-child { border-bottom: 0; }
.batch-log .success { color: #16a34a; }
.batch-log .error { color: #e5484d; }

/* ---------- 设置面板 ---------- */
.settings-overlay {
    position: fixed; inset: 0; z-index: 1999;
    background: rgba(15, 23, 42, .35);
    backdrop-filter: blur(3px);
    animation: fadeIn .2s ease;
}
.settings-panel {
    position: fixed; top: 50%; left: 50%; z-index: 2000;
    width: calc(100% - 32px); max-width: 400px; max-height: calc(100vh - 40px); overflow-y: auto;
    transform: translate(-50%, -50%);
    padding: 22px 24px 24px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .2);
    animation: panelIn .25s cubic-bezier(.16, 1, .3, 1);
}
.settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.settings-head h3 { font-size: 18px; font-weight: 650; }
#close-settings {
    width: 32px; height: 32px; border: 0; border-radius: 8px;
    background: var(--bg); color: var(--muted);
}
#close-settings:hover { color: var(--text); }
.settings-item { margin-bottom: 18px; }
.settings-item > label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.settings-item .check-label { cursor: pointer; margin-bottom: 0; }
.settings-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.range-container { display: flex; align-items: center; gap: 12px; }
.settings-range { flex: 1; accent-color: var(--primary); height: 4px; }
.range-value {
    min-width: 40px; padding: 2px 8px;
    border-radius: 6px; background: var(--primary-soft); color: var(--primary-dark);
    font-size: 13px; font-weight: 600; text-align: center;
}
.settings-select {
    width: 100%; height: 40px; padding: 0 10px;
    border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none;
}
.settings-select:focus { border-color: var(--primary); }
.settings-description { margin-top: 6px; font-size: 12px; color: var(--muted); }
.logo-upload-container { display: flex; align-items: center; gap: 10px; }
#logo-status { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
#clear-logo-btn { border: 0; background: none; color: #a3acb8; }
.apply-settings { margin-top: 4px; letter-spacing: 1px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes panelIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* ---------- 步骤 & 特性 ---------- */
.guide-section, .features-section { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.guide-section { margin-top: 64px; }
.section-title { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.steps-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step-card {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .2s, transform .2s;
}
.step-card:hover { border-color: rgba(15, 181, 160, .4); transform: translateY(-2px); }
.step-number {
    width: 32px; height: 32px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: var(--primary-soft); color: var(--primary-dark);
    font-weight: 700;
}
.step-card h3 { font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.step-card p { font-size: 13px; color: var(--muted); }

.features-section { margin-top: 40px; text-align: center; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.feature-item {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 16px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .6);
    border: 1px solid var(--line);
    font-size: 14px; font-weight: 500;
}
.feature-item i { color: var(--primary); }
.features-note {
    display: inline-block;
    margin-top: 16px; padding: 4px 12px;
    border-radius: 999px;
    background: var(--primary-soft); color: var(--primary-dark);
    font-size: 12px; font-weight: 600;
}

/* ---------- 页脚 ---------- */
.footer {
    margin-top: 56px;
    padding: 24px;
    border-top: 1px solid var(--line);
    text-align: center;
    color: #9aa3ae;
    font-size: 13px;
    line-height: 1.9;
}
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: var(--primary); }

/* 提示 */
.toast {
    position: fixed; left: 50%; bottom: 40px; z-index: 3000;
    transform: translate(-50%, 20px);
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .88);
    color: #fff; font-size: 14px;
    opacity: 0; pointer-events: none;
    transition: all .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    .container { grid-template-columns: 1fr; }
    .input-section, .preview-section { min-height: 0; }
    .text-area, .text-ai { min-height: 200px; }
    .steps-container { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .topnav { padding: 0 16px; height: 56px; }
    .mobile-menu { top: 56px; }
    .nav-links { display: none; }
    .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
    .hero { padding: 84px 16px 20px; }
    .hero h1 { font-size: 26px; }
    .hero p { font-size: 14px; }
    .container, .guide-section, .features-section { padding: 0 14px; }
    .container { gap: 14px; }
    .toolbar { margin: 14px 14px 0; align-self: stretch; }
    .tool-btn { flex: 1; justify-content: center; }
    .input-content { padding: 14px; }
    .preview-section { padding: 22px 16px; }
    .qr-container { max-width: 240px; }
    .guide-section { margin-top: 44px; }
    .section-title { font-size: 19px; margin-bottom: 16px; }
    .footer { margin-top: 40px; }
}
