.auth-page {
    min-height: calc(100vh - var(--navbar-height));
    display: flex; align-items: center; justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
}
.auth-card {
    width: 100%; max-width: 400px;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: var(--space-2xl) var(--space-xl);
}
.auth-header { text-align: center; margin-bottom: var(--space-xl); }
.auth-header h1 { font-size: 1.3rem; font-weight: var(--font-weight-bold); margin-bottom: 4px; }
.auth-header p { font-size: 0.78rem; color: var(--color-text-muted); }

.auth-form { display: flex; flex-direction: column; gap: var(--space-md); }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label {
    font-size: 0.75rem; font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}
.form-input {
    width: 100%; padding: 9px 12px;
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: var(--radius-md); font-family: var(--font-primary);
    font-size: 0.85rem; color: var(--color-text);
    transition: border-color var(--transition-fast);
}
.form-input:focus { outline: none; border-color: var(--color-accent); }
.form-input::placeholder { color: var(--color-text-muted); }
textarea.form-input { resize: vertical; min-height: 80px; }

.auth-submit {
    width: 100%; padding: 10px; margin-top: var(--space-sm);
    background: var(--color-accent); color: var(--color-accent-text);
    border-radius: var(--radius-md); font-family: var(--font-primary);
    font-size: 0.85rem; font-weight: var(--font-weight-semibold);
    transition: background var(--transition-fast);
}
.auth-submit:hover { background: var(--color-accent-hover); }

.auth-error {
    padding: 8px 12px; border-radius: var(--radius-md);
    background: rgba(174, 68, 90, 0.1); color: var(--color-rose);
    font-size: 0.78rem; margin-bottom: var(--space-md);
}

.auth-footer {
    text-align: center; margin-top: var(--space-lg);
    font-size: 0.78rem; color: var(--color-text-muted);
}
.auth-footer a { color: var(--color-accent); }
.auth-footer a:hover { color: var(--color-accent-hover); }

/* ── Profile ── */
.profile-page { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }
.edit-page { padding-top: var(--space-2xl); }

.profile-header {
    display: flex; align-items: flex-start; gap: var(--space-xl);
    padding-bottom: var(--space-xl); border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-xl);
}
.profile-avatar { position: relative; }
.profile-role {
    position: absolute; bottom: -4px; right: -4px;
    padding: 2px 8px; border-radius: var(--radius-full);
    font-size: 0.6rem; font-weight: var(--font-weight-semibold);
    background: var(--color-accent); color: var(--color-accent-text);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 1.3rem; font-weight: var(--font-weight-bold); margin-bottom: 2px; }
.profile-handle { font-size: 0.78rem; color: var(--color-text-muted); margin-bottom: var(--space-sm); }
.profile-bio { font-size: 0.85rem; color: var(--color-text-secondary); line-height: 1.6; margin-bottom: var(--space-md); }
.profile-meta {
    display: flex; flex-wrap: wrap; gap: var(--space-lg);
    font-size: 0.75rem; color: var(--color-text-muted);
}
.profile-meta-item { display: flex; align-items: center; gap: 4px; }
.profile-meta-item svg { width: 13px; height: 13px; }
.profile-actions { flex-shrink: 0; }

.profile-section { margin-bottom: var(--space-xl); }

.profile-equipment {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: var(--space-lg);
    font-size: 0.82rem; color: var(--color-text-secondary);
    line-height: 1.7; white-space: pre-line;
}

.profile-empty {
    text-align: center; padding: var(--space-3xl); color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* ── Works grid ── */
.profile-works { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-sm); }
.pw-item { position: relative; display: block; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface-elevated); }
.pw-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s cubic-bezier(.2,.7,.2,1); }
.pw-item:hover img { transform: scale(1.06); }
.pw-item.is-draft img { opacity: 0.6; }
.pw-overlay {
    position: absolute; inset: auto 0 0 0; display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 20px 10px 8px; color: #fff; font-size: 0.72rem;
    background: linear-gradient(to top, rgba(5,4,10,0.85), transparent); opacity: 0; transition: opacity var(--transition-fast);
}
.pw-item:hover .pw-overlay { opacity: 1; }
.pw-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: var(--font-weight-medium); }
.pw-likes { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }
.pw-likes svg { width: 11px; height: 11px; }
.pw-draft { position: absolute; top: 6px; right: 6px; }
@media (max-width: 640px) { .profile-works { grid-template-columns: repeat(3, 1fr); } }

/* ── Favorites ── */
.fav-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }
.fav-item {
    display: flex; align-items: center; gap: var(--space-sm); padding: 8px;
    border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--color-border);
    transition: border-color var(--transition-fast);
}
.fav-item:hover { border-color: var(--color-text-muted); }
.fav-thumb { width: 52px; height: 52px; flex-shrink: 0; border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface-elevated); display: flex; align-items: center; justify-content: center; }
.fav-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fav-thumb-news svg { width: 20px; height: 20px; color: var(--color-text-muted); }
.fav-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fav-title { font-size: 0.82rem; font-weight: var(--font-weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-sub { font-size: 0.68rem; color: var(--color-text-muted); }
@media (max-width: 640px) { .fav-list { grid-template-columns: 1fr; } }

/* ── Edit ── */
.edit-page { padding-bottom: var(--space-2xl); }
.edit-form { max-width: 560px; }
.edit-avatar-row {
    display: flex; align-items: center; gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}
.edit-avatar-upload {
    font-size: 0.78rem; color: var(--color-accent);
}
.edit-avatar-upload input[type="file"] { display: none; }
.edit-avatar-upload label { cursor: pointer; }
.edit-avatar-upload label:hover { color: var(--color-accent-hover); }

/* ── Equipment editor (add-style) ── */
.equip-input-row { display: flex; gap: var(--space-sm); align-items: stretch; }
.equip-input-row .form-input { flex: 1; }
.equip-input-row .btn { flex-shrink: 0; padding: 8px 14px; }
.equip-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-sm); }
.equip-chips:empty { margin-top: 0; }
.equip-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 6px 5px 12px; border-radius: var(--radius-full);
    background: var(--color-accent-soft); color: var(--color-text);
    border: 1px solid var(--color-border); font-size: 0.8rem;
}
.equip-name { font-weight: var(--font-weight-medium); }
.equip-remove {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: var(--radius-full);
    color: var(--color-text-muted); transition: all var(--transition-fast);
}
.equip-remove:hover { background: var(--color-rose); color: #fff; }
.equip-remove svg { width: 11px; height: 11px; }

/* ── Equipment display (profile) ── */
.equip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.equip-tag {
    display: inline-flex; align-items: center;
    padding: 6px 14px; border-radius: var(--radius-full);
    background: var(--color-surface); border: 1px solid var(--color-border);
    font-size: 0.82rem; font-weight: var(--font-weight-medium); color: var(--color-text-secondary);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .profile-meta { justify-content: center; }
    .profile-actions { align-self: stretch; }
    .profile-actions .btn { width: 100%; justify-content: center; }
}

/* ═══════════════ Auth polish ═══════════════ */
.auth-logo {
    width: 46px; height: 46px; margin: 0 auto var(--space-md);
    border-radius: var(--radius-md);
    background: var(--color-accent-soft); color: var(--color-accent);
    display: flex; align-items: center; justify-content: center;
}
.auth-logo svg { width: 24px; height: 24px; }
.auth-header h1 { font-size: 1.4rem; letter-spacing: -0.01em; }

.auth-error {
    display: flex; align-items: flex-start; gap: 8px;
    line-height: 1.5;
}
.auth-error svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
.auth-error div div { margin: 1px 0; }

.label-optional {
    font-size: 0.68rem; font-weight: var(--font-weight-normal);
    color: var(--color-text-muted); margin-left: 4px;
}
.form-help { font-size: 0.7rem; color: var(--color-text-muted); line-height: 1.45; }
.form-input.is-invalid { border-color: var(--color-rose); }
.form-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(174, 68, 90, 0.15); }

.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .form-input { padding-right: 40px; width: 100%; }
.input-reveal {
    position: absolute; right: 4px; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: var(--color-text-muted); border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}
.input-reveal:hover { color: var(--color-text-secondary); }
.input-reveal svg { width: 16px; height: 16px; }
.input-reveal.is-on { color: var(--color-accent); }

/* 即時欄位狀態 */
.field-status {
    font-size: 0.72rem; line-height: 1.4; min-height: 1em;
    display: flex; align-items: center; gap: 5px;
}
.field-status:empty { display: none; }
.field-status::before {
    content: ''; width: 12px; height: 12px; flex-shrink: 0;
    background-repeat: no-repeat; background-position: center; background-size: contain;
}
.field-status.status-ok { color: #3fb37f; }
.field-status.status-ok::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233fb37f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.field-status.status-error { color: var(--color-rose); }
.field-status.status-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23AE445A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}
.field-status.status-checking { color: var(--color-text-muted); }
.field-status.status-checking::before {
    border: 2px solid var(--color-border); border-top-color: var(--color-text-muted);
    border-radius: 50%; width: 11px; height: 11px; background: none;
    animation: fs-spin 0.7s linear infinite;
}
@keyframes fs-spin { to { transform: rotate(360deg); } }

/* 密碼規則清單 */
.pw-reqs { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.pw-reqs li {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.72rem; color: var(--color-text-muted);
    transition: color var(--transition-fast);
}
.pw-reqs .pw-mark {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
    border: 1.5px solid var(--color-text-muted);
    background-repeat: no-repeat; background-position: center; background-size: 9px;
    transition: all var(--transition-fast);
}
.pw-reqs li.met { color: #3fb37f; }
.pw-reqs li.met .pw-mark {
    border-color: #3fb37f; background-color: #3fb37f;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

/* 送出鍵停用狀態 */
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-submit:disabled:hover { background: var(--color-accent); }

/* ═══════════════ Account dashboard ═══════════════ */
.dash-grid {
    display: grid; gap: var(--space-lg);
    grid-template-columns: 1.4fr 1fr;
    margin-bottom: var(--space-2xl);
}
.dash-grid .dash-locations { grid-column: 1 / -1; }
@media (max-width: 860px) {
    .dash-grid { grid-template-columns: 1fr; }
}

.dash-card {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-xl); padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column;
}
.dash-card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--space-md);
}
.dash-count {
    font-size: 0.72rem; font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    background: var(--color-surface-elevated); border: 1px solid var(--color-border);
    padding: 1px 9px; border-radius: var(--radius-full);
}
.dash-blank {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; gap: var(--space-sm);
    padding: var(--space-lg) var(--space-sm); color: var(--color-text-muted);
}
.dash-blank svg { width: 30px; height: 30px; color: var(--color-text-muted); opacity: 0.6; }
.dash-blank p { font-size: 0.78rem; line-height: 1.6; max-width: 34ch; }

/* Wallet */
.dash-wallet { background:
    linear-gradient(150deg, var(--color-accent-soft), transparent 55%), var(--color-surface); }
.wallet-balance { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-lg); }
.wallet-coin { width: 40px; height: 40px; color: var(--color-accent); flex-shrink: 0; }
.wallet-amount {
    font-size: 2rem; font-weight: var(--font-weight-bold); letter-spacing: -0.02em;
    line-height: 1.05; color: var(--color-text); word-break: break-all;
}
.wallet-unit { font-size: 0.72rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.wallet-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-sm);
    padding-top: var(--space-md); border-top: 1px solid var(--color-border-subtle);
}
.wallet-stat { display: flex; flex-direction: column; gap: 2px; }
.wallet-stat-val { font-size: 1rem; font-weight: var(--font-weight-semibold); color: var(--color-text); }
.wallet-stat-label { font-size: 0.66rem; color: var(--color-text-muted); }
.wallet-inventory { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-md); }
.inv-chip {
    font-size: 0.7rem; color: var(--color-text-secondary);
    background: var(--color-surface-elevated); border: 1px solid var(--color-border);
    padding: 3px 9px; border-radius: var(--radius-full);
}
.inv-chip b { color: var(--color-text); }
@media (max-width: 480px) { .wallet-stats { grid-template-columns: repeat(2, 1fr); } }

/* Status dot */
.status-dot {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.7rem; font-weight: var(--font-weight-medium);
}
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.status-on { color: #3fb37f; } .status-on::before { background: #3fb37f; box-shadow: 0 0 0 3px rgba(63,179,127,0.15); }
.status-off { color: var(--color-text-muted); } .status-off::before { background: var(--color-text-muted); }

/* Discord */
.discord-linked { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; }
.discord-ident { display: flex; align-items: center; gap: var(--space-sm); }
.discord-ident svg { width: 30px; height: 30px; color: #5865F2; flex-shrink: 0; }
.discord-name { font-size: 0.9rem; font-weight: var(--font-weight-semibold); }
.discord-sub { font-size: 0.7rem; color: var(--color-text-muted); }
.btn-danger { color: var(--color-rose); }
.btn-danger:hover { border-color: var(--color-rose); color: var(--color-rose); }
.discord-code-box { display: flex; flex-direction: column; gap: var(--space-sm); }
.discord-instr { font-size: 0.78rem; color: var(--color-text-secondary); line-height: 1.5; }
.code-copy {
    display: flex; align-items: stretch; gap: 0;
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
    background: var(--color-bg); overflow: hidden;
}
.link-code {
    flex: 1; min-width: 0; display: flex; align-items: center;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 1.05rem; font-weight: var(--font-weight-semibold); letter-spacing: 0.06em;
    color: var(--color-accent); padding: 10px 14px;
    white-space: nowrap; overflow-x: auto;
}
.copy-btn {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
    padding: 0 14px; border-left: 1px solid var(--color-border);
    background: var(--color-surface-elevated); color: var(--color-text-secondary);
    font-family: var(--font-primary); font-size: 0.75rem; font-weight: var(--font-weight-medium);
    transition: background var(--transition-fast), color var(--transition-fast);
}
.copy-btn:hover { background: var(--color-accent-soft); color: var(--color-accent); }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn.copied { color: #3fb37f; }
.discord-hint { font-size: 0.7rem; color: var(--color-text-muted); }
.code-countdown {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.75rem; color: var(--color-text-secondary);
}
.code-countdown svg { width: 14px; height: 14px; color: var(--color-text-muted); flex-shrink: 0; }
.countdown-time {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-weight: var(--font-weight-semibold); color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.code-countdown.is-urgent .countdown-time,
.code-countdown.is-urgent svg { color: var(--color-rose); }
.code-countdown.expired { color: var(--color-rose); flex-wrap: wrap; }
.code-countdown.expired svg { color: var(--color-rose); }
.code-countdown.expired .countdown-time { color: var(--color-rose); }

/* Locations */
.loc-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.loc-item { display: flex; flex-direction: column; border-radius: var(--radius-md); transition: background var(--transition-fast); }
.loc-item:hover { background: var(--color-surface-elevated); }
.loc-main { display: flex; align-items: center; gap: var(--space-sm); padding: 10px 8px; }
.loc-pin { width: 17px; height: 17px; color: var(--color-accent); flex-shrink: 0; }
.loc-body { flex: 1; min-width: 0; }
.loc-label { font-size: 0.85rem; font-weight: var(--font-weight-medium); display: flex; align-items: center; }
.loc-coords { font-size: 0.72rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.loc-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity var(--transition-fast); }
.loc-item:hover .loc-actions, .loc-actions:focus-within { opacity: 1; }
@media (hover: none) { .loc-actions { opacity: 1; } }
.loc-act {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    color: var(--color-text-muted); transition: all var(--transition-fast);
}
.loc-act:hover { background: var(--color-surface); color: var(--color-text); }
.loc-act.loc-del:hover { color: var(--color-rose); }
.loc-act svg { width: 15px; height: 15px; }
.loc-rename-form { display: flex; gap: var(--space-sm); padding: 0 8px 10px 34px; }
.loc-rename-form[hidden] { display: none; }   /* 作者 display 會蓋過 [hidden]，需明確關閉 */
.loc-rename-form .form-input { flex: 1; }
.loc-rename-form .btn { flex-shrink: 0; }

/* ── Avatar crop modal ── */
.crop-modal {
    position: fixed; inset: 0; z-index: 300;
    display: flex; align-items: center; justify-content: center;
    background: rgba(5, 4, 10, 0.72); backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden; transition: opacity var(--transition-base), visibility var(--transition-base);
    padding: var(--space-lg);
}
.crop-modal.open { opacity: 1; visibility: visible; }
.crop-modal-panel {
    width: 100%; max-width: 360px;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: var(--space-lg);
}
.crop-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--space-md);
}
.crop-modal-header h2 { font-size: 1rem; font-weight: var(--font-weight-semibold); }
.crop-modal-close {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: var(--radius-full);
    color: var(--color-text-muted); transition: all var(--transition-fast);
}
.crop-modal-close:hover { color: var(--color-text); background: var(--color-surface-elevated); }
.crop-modal-close svg { width: 16px; height: 16px; }

.crop-viewport {
    position: relative; width: 280px; height: 280px; margin: 0 auto;
    background: #000; border-radius: var(--radius-md);
    cursor: grab; touch-action: none; user-select: none; overflow: hidden;
}
.crop-viewport.dragging { cursor: grabbing; }
.crop-inner {
    position: absolute; top: 20px; left: 20px;
    width: 240px; height: 240px; overflow: hidden; border-radius: 50%;
}
.crop-inner img { position: absolute; top: 0; left: 0; max-width: none; pointer-events: none; }
.crop-circle-overlay {
    position: absolute; top: 20px; left: 20px; width: 240px; height: 240px;
    border-radius: 50%; box-shadow: 0 0 0 9999px rgba(5, 4, 10, 0.72);
    border: 2px solid rgba(255, 255, 255, 0.9); pointer-events: none;
}
.crop-hint { text-align: center; margin-top: var(--space-sm); }

.crop-zoom-row {
    display: flex; align-items: center; gap: var(--space-sm);
    margin-top: var(--space-md);
}
.crop-zoom-icon { width: 14px; height: 14px; color: var(--color-text-muted); flex-shrink: 0; }
.crop-zoom-icon-lg { width: 18px; height: 18px; }
.crop-zoom-row input[type="range"] {
    flex: 1; accent-color: var(--color-accent); cursor: pointer;
}

.crop-modal-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-lg); }
.crop-modal-actions .auth-submit { flex: 1; margin-top: 0; }
.crop-modal-actions .btn-outline { padding: 10px 18px; }

/* 生日（月 / 日） */
.birthday-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-help.is-error { color: #d4687a; }

/* 個人橫幅 */
.profile-page.has-banner { position: relative; }
.profile-page.has-banner::before { content: ''; position: absolute; inset: 0; background: var(--banner) center / cover no-repeat; opacity: 0.28; z-index: 0; pointer-events: none; mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.15) 100%); -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.15) 100%); }
.profile-page.has-banner > .container { position: relative; z-index: 1; }
.banner-edit { display: grid; gap: 8px; }
.banner-preview { height: 140px; border-radius: 12px; background: var(--color-surface-elevated) center / cover no-repeat; border: 1px dashed var(--color-border); display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); font-size: 0.8rem; }
.banner-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.banner-remove { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--color-text-muted); }

/* ── 星穹遠征進度（個人檔案） ── */
.prpg-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.prpg-planet { width: 56px; height: 56px; image-rendering: pixelated; }
.prpg-id b { display: block; font-size: 1.05rem; }
.prpg-id small { opacity: .75; font-size: .82rem; }
.prpg-nums { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.prpg-nums div { text-align: center; }
.prpg-nums b { display: block; font-size: 1.05rem; color: var(--color-accent, #ffd76a); }
.prpg-nums small { display: block; opacity: .7; font-size: .7rem; }
.prpg-zone { margin: 10px 0 0; font-size: .85rem; opacity: .8; }
.prpg-gear { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.prpg-slot { display: grid; grid-template-columns: 34px 1fr; grid-template-areas: "n n" "i t" "i s"; gap: 2px 8px; align-items: center;
  padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.prpg-slot .prpg-slotname { grid-area: n; font-size: .7rem; opacity: .6; margin-bottom: 2px; }
.prpg-slot img { grid-area: i; width: 34px; height: 34px; image-rendering: pixelated; border-radius: 6px; background: #0c0b16; }
.prpg-slot b { grid-area: t; font-size: .82rem; }
.prpg-slot small { grid-area: s; font-size: .7rem; opacity: .65; }
.prpg-slot b.empty { grid-column: 1 / -1; opacity: .3; }
.prpg-slot.r1-b { border-color: rgba(127,211,138,.45); } .prpg-slot.r2-b { border-color: rgba(111,168,255,.45); }
.prpg-slot.r3-b { border-color: rgba(197,140,255,.5); } .prpg-slot.r4-b { border-color: rgba(255,178,87,.5); }
.prpg-slot.r5-b { border-color: rgba(255,226,122,.7); box-shadow: 0 0 10px rgba(255,226,122,.25); }
.prpg-crew { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.prpg-crewtag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: rgba(120,140,255,.14); border: 1px solid rgba(120,140,255,.35); font-size: .8rem; }
.prpg-crewtag img { width: 20px; height: 20px; image-rendering: pixelated; }
.prpg .r0 { color: inherit; } .prpg .r1 { color: #7fd38a; } .prpg .r2 { color: #6fa8ff; }
.prpg .r3 { color: #c58cff; } .prpg .r4 { color: #ffb257; } .prpg .r5 { color: #ffe27a; }

/* Discord 綁定：強調只適用於 EAU 東區伺服器 */
.discord-scope {
    display: flex; gap: 8px; align-items: flex-start;
    margin: 0 0 12px; padding: 10px 12px;
    border: 1px solid rgba(233, 196, 106, 0.5); border-left-width: 3px;
    border-radius: 8px; background: rgba(233, 196, 106, 0.10);
    font-size: 0.8rem; line-height: 1.55; color: var(--text-primary, #eee);
}
.discord-scope b { color: #ffd97a; }
.discord-scope-ic { flex: none; color: #ffd97a; font-size: 0.95rem; line-height: 1.4; }
.discord-instr b { color: #ffd97a; }

/* 註冊後的歡迎提示：提醒可以去綁 EAU 東區 Discord */
.welcome-note {
    position: relative; display: flex; gap: 12px; align-items: flex-start;
    margin: 0 0 var(--space-lg, 24px); padding: 14px 40px 14px 16px;
    border: 1px solid rgba(243, 159, 90, .45); border-left-width: 3px; border-radius: 10px;
    background: rgba(243, 159, 90, .09);
}
.welcome-ic { flex: none; font-size: 1.35rem; line-height: 1.2; }
.welcome-body { min-width: 0; }
.welcome-body b { display: block; margin-bottom: 4px; font-size: .95rem; }
.welcome-body p { margin: 0 0 6px; font-size: .82rem; line-height: 1.65; }
.welcome-body .welcome-sub { opacity: .72; font-size: .76rem; }
.welcome-body .btn { margin-top: 6px; }
.welcome-x {
    position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid var(--color-border); background: transparent; color: var(--color-text-secondary);
    cursor: pointer; line-height: 1; font-size: .8rem;
}
.welcome-x:hover { color: var(--color-text); border-color: var(--color-text-muted); }

/* 被歡迎提示指過去時閃一下，讓人找得到 */
.dash-discord.is-flash { animation: card-flash 1.2s ease-in-out 2; }
@keyframes card-flash {
    0%, 100% { box-shadow: 0 0 0 0 rgba(243, 159, 90, 0); }
    50% { box-shadow: 0 0 0 4px rgba(243, 159, 90, .35); }
}

/* 橫幅裁切（寬幅）------------------------------------------------------- */
.crop-modal-wide .crop-viewport { width: 400px; height: 160px; }
.crop-modal-wide .crop-inner {
    top: 20px; left: 20px; width: 360px; height: 120px; border-radius: var(--radius-sm);
}
.crop-rect-overlay {
    position: absolute; top: 20px; left: 20px; width: 360px; height: 120px;
    border-radius: var(--radius-sm); box-shadow: 0 0 0 9999px rgba(5, 4, 10, 0.72);
    border: 2px solid rgba(255, 255, 255, 0.9); pointer-events: none;
}
@media (max-width: 480px) {
    .crop-modal-wide .crop-viewport { width: 280px; height: 133px; }
    .crop-modal-wide .crop-inner,
    .crop-modal-wide .crop-rect-overlay { top: 20px; left: 20px; width: 240px; height: 80px; }
}

/* SVG 數值圖示 ---------------------------------------------------------- */
.ico { width: 1em; height: 1em; vertical-align: -0.125em; fill: none; }
.prpg-nums b .ico { width: .95em; height: .95em; margin-right: 4px; opacity: .9; }
.prpg-slot small .ico { width: .9em; height: .9em; margin-right: 3px; opacity: .8; }

/* 個人檔案：魔法搭配 ---------------------------------------------------- */
.prpg-spells { margin-top: 14px; }
.prpg-subtitle { display: flex; align-items: center; gap: 6px; font-size: .78rem; opacity: .7; margin-bottom: 8px; }
.prpg-spellrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.prpg-spell {
    position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 2px 9px; align-items: center;
    padding: 8px 10px; border-radius: 10px;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
}
.prpg-spell img { grid-column: 1; grid-row: 1 / 3; width: 34px; height: 34px; image-rendering: pixelated; border-radius: 7px; background: #0c0b16; }
.prpg-spell b { grid-column: 2; font-size: .84rem; }
.prpg-spell small { grid-column: 2; font-size: .68rem; opacity: .65; }
.prpg-spellkey {
    position: absolute; top: 4px; right: 7px; font-size: .62rem; opacity: .45;
    font-variant-numeric: tabular-nums;
}
.prpg-spell.is-holy {
    border-color: rgba(255,226,122,.5);
    background: linear-gradient(180deg, rgba(255,226,122,.13), rgba(255,255,255,.03));
}
.prpg-spell.is-holy .prpg-spellkey { color: #ffe27a; opacity: .95; }
