.app-shell { min-height: 100vh; position: relative; z-index: 1; }
:root {
    --text: rgba(255,255,255,0.92);
    --muted: rgba(255,255,255,0.52);
    --brand: #3b82f6;
    --brand-2: #19d3ff;
    --panel: rgba(15,23,42,0.80);
    --panel-2: rgba(15,23,42,0.60);
    --border: rgba(255,255,255,0.10);
    --ok: #22c55e;
    --danger: #ef4444;
    --radius: 10px;
    --shadow: none;
}
body { background: #0f172a !important; }
body.theme-cikr::before,
body.theme-cikr::after { display: none !important; }
.index-grid-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
}
.index-grid-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    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: 40px 40px;
}
.index-grid-bg::after {
    content: "";
    position: absolute;
    top: 15%;
    right: 10%;
    width: 300px;
    height: 300px;
    background: rgba(59,130,246,0.25);
    border-radius: 50%;
    filter: blur(80px);
}
.index-blur-2 {
    position: absolute;
    bottom: 10%;
    left: 5%;
    width: 400px;
    height: 400px;
    background: rgba(30,64,175,0.3);
    border-radius: 50%;
    filter: blur(100px);
}
.app-header { background: rgba(15,23,42,0.95) !important; border-bottom: 1px solid rgba(255,255,255,0.08) !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.nav-link { color: rgba(255,255,255,0.75) !important; }
.nav-link:hover { color: #fff !important; }
.nav-link.active { color: #fff !important; }
.nav-link.active::after { background: #3b82f6 !important; }
.brand-text { color: #fff !important; background: none !important; -webkit-background-clip: unset !important; background-clip: unset !important; -webkit-text-fill-color: unset !important; }
.brand-dot { background: #3b82f6 !important; box-shadow: 0 0 10px rgba(59,130,246,0.5) !important; }
.hero-title { color: #fff !important; background: none !important; -webkit-background-clip: unset !important; background-clip: unset !important; -webkit-text-fill-color: unset !important; }
.hero-sub { color: rgba(255,255,255,0.60) !important; }
.chip { background: rgba(255,255,255,0.06) !important; border-color: rgba(255,255,255,0.12) !important; color: rgba(255,255,255,0.80) !important; box-shadow: none !important; }
.glass { background: rgba(15,23,42,0.20) !important; border: 1px solid rgba(59,130,246,0.25) !important; border-radius: 12px !important; box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important; backdrop-filter: blur(40px) !important; -webkit-backdrop-filter: blur(40px) !important; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.glass:hover { transform: translateY(-2px); border-color: rgba(59,130,246,0.50) !important; box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important; }
#demo .glass { background: transparent !important; border: none !important; border-radius: 0 !important; box-shadow: none !important; backdrop-filter: none !important; }
#generate .glass, #video .glass, #plugin .glass, #recharge .glass, #account .glass, #feedback .glass { background: rgba(15,23,42,0.20) !important; border: 1px solid rgba(59,130,246,0.25) !important; border-radius: 12px !important; box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important; backdrop-filter: blur(40px) !important; -webkit-backdrop-filter: blur(40px) !important; }
#generate .glass:hover, #video .glass:hover, #plugin .glass:hover, #recharge .glass:hover, #account .glass:hover, #feedback .glass:hover { border-color: rgba(59,130,246,0.50) !important; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important; }
.kpi-item { background: rgba(15,23,42,0.20) !important; border: 1px solid rgba(59,130,246,0.25) !important; box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important; backdrop-filter: blur(40px) !important; -webkit-backdrop-filter: blur(40px) !important; }
.kpi-item:hover { transform: translateY(-2px); border-color: rgba(59,130,246,0.50) !important; box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important; }
.model-card { background: rgba(15,23,42,0.20) !important; border: 1px solid rgba(59,130,246,0.25) !important; box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important; backdrop-filter: blur(40px) !important; -webkit-backdrop-filter: blur(40px) !important; }
.model-card:hover { transform: translateY(-2px); border-color: rgba(59,130,246,0.50) !important; box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important; }
.model-name { color: rgba(255,255,255,0.9) !important; }
.model-price { background: rgba(59,130,246,0.15) !important; border-color: rgba(59,130,246,0.25) !important; color: rgba(255,255,255,0.9) !important; }
.badge-soft { background: rgba(59,130,246,0.15) !important; color: rgba(255,255,255,0.6) !important; }
.section-title { color: #fff !important; }
.section-title::before { background: #3b82f6 !important; }
body:not(.light-theme) .section-panel { background: rgba(15,23,42,0.20) !important; border: 1px solid rgba(59,130,246,0.25) !important; box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important; backdrop-filter: blur(40px) !important; -webkit-backdrop-filter: blur(40px) !important; }
body:not(.light-theme) .section-panel:hover { border-color: rgba(59,130,246,0.40) !important; }
.section-sub { color: rgba(255,255,255,0.55) !important; }
.btn-primary { background: linear-gradient(135deg, #1e40af, #3b82f6) !important; border-color: transparent !important; box-shadow: 0 4px 12px rgba(59,130,246,0.25) !important; }
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #2563eb) !important; }
.form-control { background: rgba(15,23,42,0.50) !important; border: 1px solid rgba(59,130,246,0.25) !important; color: rgba(255,255,255,0.9) !important; }
.form-control:focus { background: rgba(15,23,42,0.70) !important; border-color: #3b82f6 !important; box-shadow: 0 0 0 3px rgba(59,130,246,0.15) !important; }
.form-control::placeholder { color: rgba(255,255,255,0.4) !important; }
.input-group-text { background: rgba(59,130,246,0.15) !important; border: 1px solid rgba(59,130,246,0.25) !important; color: rgba(255,255,255,0.9) !important; }
.announcement-modal { background: rgba(15,23,42,0.95) !important; border: 1px solid rgba(255,255,255,0.15) !important; box-shadow: 0 8px 40px rgba(0,0,0,0.5) !important; backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important; }
.announcement-modal__header { border-bottom-color: rgba(255,255,255,0.06) !important; }
.announcement-modal__title { color: rgba(255,255,255,0.9) !important; }
.announcement-modal__countdown { color: rgba(255,255,255,0.55) !important; }
.announcement-modal__item { border-bottom-color: rgba(255,255,255,0.06) !important; }
.announcement-modal__item-title { color: rgba(255,255,255,0.9) !important; }
.announcement-modal__item-time { color: rgba(255,255,255,0.45) !important; }
.announcement-modal__item-content { color: rgba(255,255,255,0.7) !important; }
.announcement-modal__empty { color: rgba(255,255,255,0.55) !important; }
.announce-item__headline { color: rgba(255,255,255,0.9) !important; }
.announce-item .small-muted { color: rgba(255,255,255,0.45) !important; }
.announce-item__icon { background: rgba(59,130,246,0.15) !important; border-color: rgba(59,130,246,0.25) !important; color: rgba(255,255,255,0.9) !important; }
.announce-top__headline { color: rgba(255,255,255,0.9) !important; }
.announce-content { color: rgba(255,255,255,0.55) !important; }
.announce-meta i { color: rgba(255,255,255,0.45) !important; }
.announce-top__icon i { color: rgba(255,255,255,0.9) !important; }
.demo-masonry__item { background: rgba(15,23,42,0.20) !important; border: 1px solid rgba(59,130,246,0.25) !important; box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important; backdrop-filter: blur(40px) !important; -webkit-backdrop-filter: blur(40px) !important; }
.demo-masonry__item:hover { border-color: rgba(59,130,246,0.50) !important; box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important; }
.toast-card { background: rgba(15,23,42,0.95) !important; border-color: rgba(255,255,255,0.15) !important; border-left-color: #3b82f6 !important; color: rgba(255,255,255,0.90) !important; box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important; backdrop-filter: blur(40px) !important; -webkit-backdrop-filter: blur(40px) !important; }
.toast-title { color: #fff !important; }
.toast-msg { color: rgba(255,255,255,0.60) !important; }
.js-plan-card.is-selected, .js-payment-card.is-selected { border-color: #3b82f6 !important; background: rgba(59,130,246,0.08) !important; }
.img-preview-dialog { background: rgba(15,23,42,0.95) !important; border: 1px solid rgba(255,255,255,0.15) !important; box-shadow: 0 8px 40px rgba(0,0,0,0.5) !important; backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important; }
.img-preview-close { background: rgba(255,255,255,0.06) !important; border-color: rgba(255,255,255,0.10) !important; color: rgba(255,255,255,0.75) !important; }
.table { color: rgba(255,255,255,0.85) !important; }
.table td, .table th { border-color: rgba(255,255,255,0.06) !important; }
.ref-thumb__img { background: rgba(0,0,0,0.25) !important; }
.ref-thumb.is-active { border-color: #3b82f6 !important; }
.text-muted { color: rgba(255,255,255,0.45) !important; }
.text-dark { color: #fff !important; }
.modal-content { background: rgba(15,23,42,0.95) !important; border: 1px solid rgba(255,255,255,0.15) !important; box-shadow: 0 8px 40px rgba(0,0,0,0.5) !important; backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important; }
.modal-header { border-bottom-color: rgba(255,255,255,0.06) !important; }
.modal-footer { border-top-color: rgba(255,255,255,0.06) !important; }
.close { color: rgba(255,255,255,0.75) !important; }
select.form-control { background-color: rgba(255,255,255,0.06) !important; color: rgba(255,255,255,0.92) !important; }
.beijing-blur-bg::before { opacity: 0.20 !important; }
.beijing-blur-bg::after { background: linear-gradient(180deg, rgba(15,23,42,0.50), rgba(15,23,42,0.70)) !important; }
.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #0f172a;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
#top-actions {
    position: absolute;
    right: 140px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1040;
}
#top-brand {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1040;
}
@media (max-width: 991.98px) {
    #top-actions { right: 140px; }
    #top-brand { left: 12px; }
}
#user-menu.dropdown-menu {
    background: rgba(10,14,28,0.92) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    color: rgba(255,255,255,0.92) !important;
}
#user-menu .dropdown-item { color: rgba(255,255,255,0.88) !important; }
#user-menu .dropdown-item:hover,
#user-menu .dropdown-item:focus {
    background: rgba(255,255,255,0.10) !important;
    color: #fff !important;
}
#user-menu .dropdown-divider { border-top-color: rgba(255,255,255,0.10) !important; }
.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #1e40af;
}
.brand-text {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #1e40af;
    font-weight: 800;
}
.brand-logo {
    height: 36px;
    width: auto;
    display: block;
}
.partner-text {
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 700;
    font-size: 16px;
    font-family: "SimHei", "黑体", "Microsoft YaHei", sans-serif;
    padding: 14px 18px !important;
    transition: color 0.3s ease;
}
#topnav { padding: 6px 0; }
#topnav .nav-link { padding: 18px 18px !important; }
.nav-link .mdi {
    font-size: 18px;
    line-height: 0;
    vertical-align: -2px;
}
.nav-link:hover { color: #3b82f6 !important; }
.nav-link.active { color: #3b82f6 !important; position: relative; }
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #1e40af;
    border-radius: 2px;
}
.nav-pill {
    border-radius: 0;
    border: none;
    background: transparent;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.app-container { max-width: 1920px; }
.hero {
    padding: 0 0 20px;
    margin-top: -60px;
}
.hero-card {
    background: transparent;
    border: none;
    border-radius: 24px;
    box-shadow: none;
    overflow: hidden;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    position: relative;
}
.hero-card::before {
    display: none;
}
.hero-title { font-size: 48px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; margin: 0; color: #0f172a; }
.hero-sub { color: #6b7280; font-size: 16px; margin: 16px 0 0; font-weight: 400; max-width: 600px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    font-weight: 600;
    font-size: 12px;
    box-shadow: none;
}
.section {
    padding: 40px 0 10px;
}
.section-anchor { scroll-margin-top: 100px; }
.section-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
}
.section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 20px;
    background: #1e40af;
    border-radius: 2px;
}
.section-sub { color: #6b7280; margin: 0 0 24px; font-size: 15px; }
.glass {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: none;
    transition: border-color 0.2s;
}
#demo .glass {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}
#demo .glass:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}
#generate .glass,
#video .glass,
#plugin .glass,
#recharge .glass,
#account .glass,
#feedback .glass {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: none;
}
#generate .glass:hover,
#video .glass:hover,
#plugin .glass:hover,
#recharge .glass:hover,
#account .glass:hover,
#feedback .glass:hover {
    transform: none;
    box-shadow: none;
    border-color: #3b82f6;
}
.glass:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
}
body.theme-cikr:not(.light-theme) .section-panel {
    border: 1px solid #e5e7eb;
    box-shadow: none;
}
body.theme-cikr:not(.light-theme) .section-panel:hover {
    border-color: #3b82f6;
    box-shadow: none;
}
.glass-2 { background: var(--panel-2); border-radius: 16px; border: 1px solid var(--border); }
#theme-toggle {
    border: none !important;
    box-shadow: none !important;
    background: transparent;
}
.small-muted { color: var(--muted); font-size: 13px; letter-spacing: 0.02em; }
#recharge-submit {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.02em;
}
.recharge-tip {
    margin-top: 18px;
    text-align: center;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.7;
    background: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: none;
}
.recharge-tip-em-red {
    background: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: none;
}
.recharge-tip-em-blue {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}
.payment-time-window-text {
    margin-top: 10px;
    font-size: 16px;
    font-weight: 800;
    color: rgba(255,255,255,0.92);
}
.kpi {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
@media (max-width: 992px) {
    .hero-title { font-size: 36px; }
    .kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kpi-item {
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    transition: border-color 0.2s;
}
.kpi-item:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
}
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: 24px; font-weight: 800; margin-top: 8px; letter-spacing: -0.02em;
    background: linear-gradient(90deg, var(--text), var(--muted));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.model-card {
    height: 100%;
    min-height: 360px;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    position: relative;
    transition: border-color 0.2s;
    overflow: hidden;
    box-shadow: none;
}
.model-card:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
    box-shadow: none;
}
.model-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.model-status-dot {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--muted);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.05);
    border: none;
}
.model-status-dot.is-ok { background: var(--ok); box-shadow: 0 0 10px var(--ok); border-color: transparent; }
.model-status-dot.is-bad { background: var(--danger); box-shadow: 0 0 10px var(--danger); border-color: transparent; }
.model-status-dot.is-unknown { background: var(--muted); border-color: transparent; }
.model-status-dot.is-loading {
    background: var(--brand);
    border-color: transparent;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 242, 234, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 242, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 242, 234, 0); }
}
.js-plan-card.is-selected,
.js-payment-card.is-selected {
    border-color: #1e40af !important;
    background: #eff6ff;
    transform: scale(1.01);
}
.model-name { font-weight: 700; margin: 0; font-size: 20px; letter-spacing: -0.01em; color: #0f172a; position: relative; display: inline-block; z-index: 0; }
.model-name::after { display: none; }
.model-desc { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.model-spec {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
    display: grid;
    gap: 10px;
}
.model-spec__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
}
.model-spec__row--inline { justify-content: flex-start; }
.model-spec__value {
    color: var(--text);
    font-weight: 700;
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 6px;
    text-align: right;
}
.model-spec__row--inline .model-spec__value { text-align: left; }
.model-features { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.model-price {
    position: absolute;
    right: 18px;
    bottom: 18px;
    font-weight: 700;
    font-size: 14px;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 4px 10px;
}
.badge-soft {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
}

.table { color: var(--text); }
.table thead th {
    border-bottom-color: var(--border);
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}
.table td, .table th { border-top-color: var(--border); padding: 12px 16px; vertical-align: middle; }

.toast-container { position: fixed; left: 50%; bottom: 28vh; transform: translateX(-50%); z-index: 2000; width: 360px; max-width: calc(100vw - 48px); }
.toast-card {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 12px;
    border-left: 4px solid #1e40af;
    animation: slideIn 0.3s ease;
}
.toast-title { font-weight: 700; font-size: 14px; margin: 0; display: flex; align-items: center; gap: 8px; color: #0f172a; }
.toast-msg { color: #6b7280; font-size: 13px; margin: 6px 0 0; line-height: 1.5; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.announce-panel { position: relative; overflow: hidden; }
.announce-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.announce-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 16px;
    letter-spacing: -0.01em;
}
.announce-title__icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}
.announce-title__icon i { font-size: 18px; }
.announce-toggle.btn { padding: 6px 10px; border-radius: 12px; font-weight: 700; }
.announce-top {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    padding: 16px 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}
.announce-top__badge { display: inline-flex; align-items: center; gap: 6px; }
.announce-top__icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e40af;
    color: #fff;
    box-shadow: none;
}
.announce-top__icon i { font-size: 22px; }
.announce-top__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.announce-top__headline { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; margin: 0; color: #0f172a; }
.announce-meta { display: inline-flex; align-items: center; gap: 8px; }
.announce-meta i { opacity: 0.9; color: #6b7280; }
.announce-content { margin-top: 10px; color: #6b7280; font-size: 14px; line-height: 1.75; }
.announce-list { display: grid; gap: 10px; margin-top: 12px; }
.announce-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
}
.announce-item__icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
}
.announce-item__icon i { font-size: 18px; opacity: 0.95; }
.announce-item__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.announce-item__headline { font-weight: 700; font-size: 15px; margin: 0; line-height: 1.25; color: #111827; }
.announce-item .small-muted { font-size: 12px; color: #9ca3af; }
.announcement-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(0,0,0,0.78);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px 12px;
}
.announcement-modal-overlay.is-open { display: flex; animation: announcementFadeIn 0.25s ease; }
@keyframes announcementFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.announcement-modal {
    width: min(860px, 92vw);
    max-height: 80vh;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: announcementScaleIn 0.3s ease;
}
@keyframes announcementScaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
.announcement-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.announcement-modal__title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 20px;
    color: #0f172a;
}
.announcement-modal__title i { font-size: 26px; color: #f97316; }
.announcement-modal__countdown {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}
.announcement-modal__countdown span {
    display: inline-block;
    min-width: 20px;
    text-align: center;
    font-weight: 800;
    color: #f97316;
}
.announcement-modal__body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}
.announcement-modal__item {
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}
.announcement-modal__item:last-child { border-bottom: none; }
.announcement-modal__item-title {
    font-weight: 800;
    font-size: 16px;
    color: #111827;
    margin-bottom: 6px;
}
.announcement-modal__item-time {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 10px;
}
.announcement-modal__item-content {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
}
.announcement-modal__empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
}

#task-queue-modal.queue-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(2, 6, 23, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px 12px;
}
#task-queue-modal.queue-sheet-overlay.is-open { display: flex; }
#task-queue-modal .queue-sheet {
    width: min(920px, 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-height: min(80vh, 760px);
    overflow: auto;
    margin: 0 auto;
}
#task-queue-modal .queue-sheet-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(10,14,28,0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 10px;
}
.page-section { display: none; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page-section.is-active { display: block; }

.demo-masonry {
    column-count: 4;
    column-gap: 12px;
    padding: 0 30px;
}
.demo-masonry__item {
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(59,130,246,0.25);
    background: rgba(15,23,42,0.20);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.demo-masonry__item:hover {
    transform: translateY(-2px);
    border-color: rgba(59,130,246,0.50);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.demo-masonry__item img {
    width: 100%;
    height: auto;
    display: block;
}
@media (max-width: 1200px) { .demo-masonry { column-count: 3; } }
@media (max-width: 992px) { .demo-masonry { column-count: 2; padding: 0 16px; } }
@media (max-width: 576px) { .demo-masonry { column-count: 1; padding: 0 12px; } }


.gen-layout {
    display: flex;
    gap: 16px;
    align-items: stretch;
}
.gen-layout__left {
    flex: 0 0 25%;
    min-width: 0;
}
.gen-layout__center {
    flex: 1;
    min-width: 0;
}
.gen-layout__right {
    flex: 0 0 180px;
    min-width: 0;
}
.gen-left-panel {
    overflow-y: auto;
    padding-right: 8px;
}
.gen-left-panel::-webkit-scrollbar { width: 4px; }
.gen-left-panel::-webkit-scrollbar-track { background: transparent; }
.gen-left-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
.gen-price {
    font-size: 12px;
    opacity: 0.55;
    font-weight: 500;
}
.gen-gallery-panel {
    min-height: 500px;
    display: flex;
    flex-direction: column;
}
#gallery-container {
    width: 100%;
    flex: 1;
    position: relative;
    overflow: hidden;
    background: transparent;
    border-radius: var(--radius);
    user-select: none;
    -webkit-user-select: none;
}
#gallery-container::-webkit-scrollbar { width: 6px; }
#gallery-container::-webkit-scrollbar-track { background: transparent; }
#gallery-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
#gallery-grid {
    position: relative;
    width: 100%;
    height: 100%;
}
#gallery-grid .gallery-item {
    position: absolute;
    inset: 0;
    aspect-ratio: unset;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}
#gallery-grid .gallery-item:hover {
    border-color: transparent;
    box-shadow: none;
}
#gallery-grid .gallery-item.generating {
    display: flex;
    align-items: center;
    justify-content: center;
}
#gallery-grid .gallery-item.generating .gallery-item-placeholder {
    padding: 60px 40px;
}
#gallery-grid .gallery-item.generating .gallery-item-icon {
    font-size: 56px;
}
#gallery-grid .gallery-item.generating .gallery-item-progress-wrap {
    width: 60%;
    height: 8px;
}
#gallery-grid .gallery-item.generating .gallery-item-progress-text {
    font-size: 18px;
}
#gallery-grid .gallery-item.completed {
    display: flex;
    align-items: center;
    justify-content: center;
}
#gallery-grid .gallery-item-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
#gallery-grid .gallery-item-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
#gallery-empty-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255,255,255,0.15);
    pointer-events: none;
    z-index: 1;
}
#gallery-empty-hint i { font-size: 48px; display: block; margin-bottom: 12px; }
#gallery-empty-hint div { font-size: 14px; }
#gallery-empty-hint.hidden { display: none; }
.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255,255,255,0.08);
    background: transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
    aspect-ratio: 1 / 1;
}
.gallery-item:hover {
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.gallery-item.generating {
    border-color: rgba(99,102,241,0.3);
    background: rgba(99,102,241,0.05);
}
.gallery-item.failed {
    border-color: rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.05);
}
.gallery-item-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 40px 20px;
}
.gallery-item-icon {
    font-size: 36px;
    color: rgba(99,102,241,0.6);
}
.gallery-item-progress-wrap {
    width: 80%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.gallery-item-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #6366f1);
    background-size: 200% 100%;
    border-radius: 3px;
    transition: width 0.3s;
    width: 0%;
    animation: progressShimmer 1.5s ease infinite;
}
@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.gallery-item-progress-text {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}
.gallery-item-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.gallery-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-item-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 20px;
    text-align: center;
}
.gallery-item-error-icon { font-size: 28px; color: #ef4444; }
.gallery-item-error-msg { font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.5; word-break: break-word; }
.gallery-item-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.gallery-item:hover .gallery-item-actions { opacity: 1; }
.gallery-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.15s, color 0.15s;
}
.gallery-action-btn:hover { background: rgba(255,255,255,0.25); color: #fff; }
.gallery-action-btn.delete-btn:hover { background: rgba(239,68,68,0.5); color: #fff; }
.gallery-action-btn.edit-btn:hover { background: rgba(99,102,241,0.5); color: #fff; }
.gen-history-panel {
    min-height: 500px;
    display: flex;
    flex-direction: column;
}
#history-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    background: transparent;
    border-radius: var(--radius);
    user-select: none;
    -webkit-user-select: none;
}
#history-container::-webkit-scrollbar { width: 4px; }
#history-container::-webkit-scrollbar-track { background: transparent; }
#history-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
#history-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
}
#history-grid .history-thumb {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}
#history-grid .history-thumb img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}
.history-thumb-dl {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: rgba(0,0,0,0.5);
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}
.history-thumb:hover .history-thumb-dl { opacity: 1; }
.history-thumb-dl:hover { background: rgba(0,0,0,0.7); color: #fff; }
#history-empty-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255,255,255,0.15);
    pointer-events: none;
    z-index: 1;
}
#history-empty-hint i { font-size: 28px; display: block; margin-bottom: 6px; }
#history-empty-hint div { font-size: 11px; }
#history-empty-hint.hidden { display: none; }
.ref-upload-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.ref-upload-slot {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    border: 2px dashed var(--border);
    background: rgba(255,255,255,0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
    color: var(--muted);
    font-size: 20px;
    position: relative;
    overflow: hidden;
}

.ref-upload-slot:hover {
    border-color: rgba(124,92,255,0.75);
    background: rgba(255,255,255,0.05);
    color: var(--text);
}

.ref-upload-slot.is-dragover {
    border-color: rgba(124,92,255,0.95);
    background: rgba(124,92,255,0.08);
    color: var(--text);
}

.ref-upload-slot:active { transform: scale(0.96); }

.ref-upload-slot.has-image {
    border-style: solid;
    border-color: rgba(255,255,255,0.1);
    padding: 0;
}

.ref-slot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

.ref-slot-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 2;
}

.ref-upload-slot.has-image:hover .ref-slot-del { opacity: 1; }
.ref-upload-slot.has-image:hover .ref-slot-img { filter: brightness(0.8); }

.ref-upload-slot.is-dragging {
    opacity: 0.4;
}

.ref-upload-slot.is-drop-target {
    border-color: rgba(124,92,255,0.95);
    background: rgba(124,92,255,0.15);
    transform: scale(1.05);
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.ref-upload-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-thumb {
    width: calc(25% - 6px);
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}
.ref-thumb[draggable="true"] { cursor: grab; }
.ref-thumb.is-dragging { opacity: 0.6; cursor: grabbing; }
.ref-thumb.is-drop-target { outline: 2px solid rgba(124,92,255,0.95); outline-offset: 2px; }
.ref-upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    border-radius: 14px;
    border: 2px dashed var(--border);
    background: rgba(255,255,255,0.01);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.3s ease;
}
.ref-upload-dropzone:hover {
    border-color: var(--brand);
    background: rgba(0, 242, 234, 0.05);
    color: var(--brand);
    transform: scale(1.02);
}
.modal-content {
    background: #111425;
    border: 1px solid var(--border);
    border-radius: 24px;
}
.ref-thumb__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ref-thumb__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    line-height: 1.2;
}
.ref-upload-dropzone {
    width: 100%;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    padding: 6px 10px;
    min-height: 56px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease, transform .05s ease;
}
.ref-upload-dropzone:hover {
    border-color: rgba(124,92,255,0.75);
    color: var(--text);
    background: rgba(255,255,255,0.03);
}
.ref-upload-dropzone.is-dragover {
    border-color: rgba(124,92,255,0.95);
    color: var(--text);
    background: rgba(255,255,255,0.05);
}
.ref-upload-dropzone:active { transform: translateY(1px); }
.ref-upload-dropzone__inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.ref-upload-dropzone__inner i {
    font-size: 18px;
    display: inline-block;
    margin-bottom: 0;
    opacity: 0.9;
}
.ref-upload-dropzone__text { font-weight: 700; }
.ref-upload-dropzone__hint { font-weight: 500; font-size: 12px; opacity: 0.75; margin-top: 2px; }
#resolution-group.is-disabled { opacity: 0.55; }
#resolution-select:disabled {
    cursor: not-allowed;
    filter: grayscale(0.15);
}
body.light-theme #resolution-group.is-disabled { opacity: 0.65; }
.img-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0,0,0,0.78);
}
.img-preview-overlay.is-open { display: flex; }
.img-preview-dialog {
    position: relative;
    width: min(92vw, 1100px);
    height: min(92vh, 820px);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(10,14,28,0.92);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
body.light-theme .img-preview-dialog { background: #ffffff; border-color: #e5e7eb; border-radius: 12px; }
body.light-theme .img-preview-close { background: #f3f4f6; color: #374151; border-color: #e5e7eb; border-radius: 8px; }
.img-preview-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.35);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    z-index: 10;
    position: relative;
}
.img-preview-toolbar__group {
    display: flex;
    align-items: center;
    gap: 2px;
    position: relative;
}
.img-preview-toolbar__spacer { flex: 1; }
.img-preview-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.img-preview-tool-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.img-preview-tool-btn.active {
    background: rgba(59,130,246,0.25);
    border-color: rgba(59,130,246,0.5);
    color: #fff;
}
.img-preview-brush-options {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    padding: 10px 12px;
    background: rgba(10,14,28,0.95);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 20;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.img-preview-brush-size {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    outline: none;
}
.img-preview-brush-size::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.3);
}
.img-preview-color-palette {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.img-preview-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.1s;
}
.img-preview-color-swatch:hover { transform: scale(1.15); }
.img-preview-color-swatch.active { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.4); }
.img-preview-canvas-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.img-preview-canvas-wrap canvas {
    display: block;
    cursor: grab;
}
.img-preview-canvas-wrap canvas.is-dragging { cursor: grabbing; }
.img-preview-canvas-wrap canvas.is-brushing { cursor: crosshair; }
.img-preview-canvas-wrap canvas.is-cropping { cursor: crosshair; }
.img-preview-crop-overlay {
    position: absolute;
    inset: 0;
    z-index: 15;
    pointer-events: none;
}
.img-preview-crop-overlay.is-active { pointer-events: auto; }
.img-preview-crop-box {
    position: absolute;
    border: 2px dashed rgba(255,255,255,0.8);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
    cursor: move;
    display: none;
}
.img-preview-crop-overlay.is-active .img-preview-crop-box { display: block; }
.img-preview-crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 2px solid #3b82f6;
    border-radius: 2px;
    z-index: 2;
}
.img-preview-crop-handle-nw { top: -6px; left: -6px; cursor: nw-resize; }
.img-preview-crop-handle-ne { top: -6px; right: -6px; cursor: ne-resize; }
.img-preview-crop-handle-sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.img-preview-crop-handle-se { bottom: -6px; right: -6px; cursor: se-resize; }
.img-preview-crop-handle-n { top: -6px; left: 50%; margin-left: -6px; cursor: n-resize; }
.img-preview-crop-handle-s { bottom: -6px; left: 50%; margin-left: -6px; cursor: s-resize; }
.img-preview-crop-handle-w { top: 50%; margin-top: -6px; left: -6px; cursor: w-resize; }
.img-preview-crop-handle-e { top: 50%; margin-top: -6px; right: -6px; cursor: e-resize; }
.img-preview-crop-actions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    gap: 12px;
    z-index: 3;
}
.img-preview-crop-overlay.is-active .img-preview-crop-actions { display: flex; }
.img-preview-crop-btn {
    padding: 8px 24px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.6);
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.img-preview-crop-btn:hover { background: rgba(0,0,0,0.8); }
.img-preview-crop-btn--confirm { background: rgba(59,130,246,0.7); border-color: rgba(59,130,246,0.5); }
.img-preview-crop-btn--confirm:hover { background: rgba(59,130,246,0.9); }
.img-preview-zoom-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(0,0,0,0.55);
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease;
    white-space: nowrap;
    z-index: 5;
}
.img-preview-zoom-hint.fade-out { opacity: 0; }
.img-preview-zoom-badge {
    position: absolute;
    bottom: 14px;
    right: 14px;
    padding: 4px 12px;
    border-radius: 12px;
    background: rgba(0,0,0,0.5);
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    pointer-events: none;
    display: none;
    z-index: 5;
}
.img-preview-zoom-badge.visible { display: block; }
.img-preview-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(0,0,0,0.22);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.15s;
}
.img-preview-close:hover { background: rgba(239,68,68,0.5); }
.img-preview-confirm-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(34,197,94,0.4);
    background: rgba(34,197,94,0.25);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.15s;
}
.img-preview-confirm-btn:hover { background: rgba(34,197,94,0.5); }
.ref-thumb__img { cursor: zoom-in; }
.video-upload-tile {
    width: 100%;
    height: 160px;
    border-radius: 14px;
    border: 1px dashed var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    position: relative;
}
.video-upload-tile:hover {
    border-color: rgba(124,92,255,0.95);
    color: var(--text);
    background: rgba(255,255,255,0.05);
}
.video-upload-tile img { width: 100%; height: 100%; object-fit: contain; display: none; background: rgba(0,0,0,0.16); }
.video-upload-placeholder { text-align: center; padding: 14px; }
.video-upload-placeholder i { font-size: 28px; display: block; margin-bottom: 6px; opacity: 0.9; }
.video-refs-grid { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; padding: 10px; }
.video-ref-thumb { width: calc(33.333% - 6px); aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: rgba(255,255,255,0.03); position: relative; }
.video-ref-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; background: rgba(0,0,0,0.16); }
.video-upload-clear, .video-ref-clear {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(0,0,0,0.25);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}
body.light-theme .video-upload-clear,
body.light-theme .video-ref-clear {
    border-color: var(--border);
    background: rgba(15,23,42,0.06);
    color: var(--text);
}
.video-ref-clear { display: flex; }
@media (max-width: 576px) {
    .video-upload-tile { height: 140px; }
    .video-ref-thumb { width: calc(50% - 4px); }
}
@media (max-width: 576px) {
    .ref-thumb { width: calc(50% - 6px); }
}
@media (max-width: 991.98px) {
    .app-shell {
        min-height: 100dvh;
        overflow-x: hidden;
    }
    .app-header {
        padding-top: 8px;
    }
    #top-brand,
    #top-actions {
        position: static;
        transform: none;
        left: auto;
        right: auto;
        top: auto;
    }
    #top-brand {
        margin: 0 12px 8px;
    }
    #top-actions {
        margin: 0 12px 8px;
        justify-content: flex-end;
    }
    #user-menu-toggle > span {
        display: none;
    }
    #user-menu {
        max-width: calc(100vw - 24px);
    }
    #topnav {
        padding: 0 0 8px;
    }
    #topnav .navbar-nav {
        width: 100%;
    }
    #topnav .nav-item {
        width: 100%;
    }
    #topnav .nav-link {
        padding: 12px 14px !important;
        border-radius: 10px;
    }
    .nav-link.active::after {
        display: none;
    }
    .hero {
        padding: 26px 0 8px;
    }
    .hero-title {
        font-size: 34px;
    }
    .section {
        padding: 26px 0 6px;
    }
    .glass,
    .hero-card {
        border-radius: 16px;
    }
}
@media (min-width: 768px) and (max-width: 991.98px) {
    #generate .col-lg-4 {
        flex: 0 0 41.666667%;
        max-width: 41.666667%;
    }
    #generate .col-lg-8 {
        flex: 0 0 58.333333%;
        max-width: 58.333333%;
    }
}
@media (max-width: 767.98px) {
    .gen-layout {
        flex-direction: column;
    }
    .gen-layout__left,
    .gen-layout__right {
        flex: none;
        width: 100%;
    }
    .gen-layout__right {
        order: 3;
    }
    .gen-left-panel {
        max-height: none;
        padding-right: 0;
    }
    .gen-gallery-panel {
        min-height: 320px;
    }
    .gen-history-panel {
        min-height: 200px;
    }
    #history-grid {
        flex-direction: row;
        flex-wrap: wrap;
    }
    #history-grid .history-thumb {
        flex: 0 0 80px;
    }
    #gallery-grid {
        padding: 8px;
    }
    .gallery-item-actions { opacity: 1; }
    .container.app-container,
    main.app-container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .announce-strip {
        flex-wrap: wrap;
        gap: 10px;
    }
    .announce-strip__title {
        width: 100%;
    }
    #generate .d-flex.justify-content-between.align-items-center {
        flex-wrap: wrap;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    #generate .d-flex.justify-content-between.align-items-center > div {
        width: 100%;
    }
    #generate .d-flex.justify-content-between.align-items-center .btn {
        width: 100%;
    }
    #account .table {
        min-width: 540px;
    }
}
@media (max-width: 575.98px) {
    .hero-title {
        font-size: 28px;
    }
    #theme-toggle span,
    #file-count {
        display: none;
    }
    #top-actions {
        gap: 6px !important;
    }
    #top-actions .btn {
        padding: .35rem .5rem;
    }
    .ref-upload-dropzone {
        min-height: 120px;
    }
    .img-preview-dialog {
        width: 95vw;
        height: 78vh;
    }
}
