@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --secondary: #60a5fa;
    --accent: #f97316;
    --accent-strong: #ea580c;
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #1e293b;
    --muted: #475569;
    --border: #dbe4ef;
    --ok: #0f9d58;
    --error: #b42318;
    --pending: #b45309;
    --shadow-soft: 0 14px 36px rgba(37, 99, 235, 0.13);
    --shadow-strong: 0 22px 48px rgba(15, 23, 42, 0.14);
    --radius-xl: 20px;
    --radius-lg: 14px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(80rem 36rem at 5% -15%, rgba(37, 99, 235, 0.18), transparent 58%),
        radial-gradient(75rem 34rem at 95% 0%, rgba(249, 115, 22, 0.12), transparent 60%),
        linear-gradient(145deg, #f3f7ff 0%, var(--bg) 55%, #fff7f1 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header from external template */
.header {
    position: sticky;
    top: 0;
    z-index: 60;
    border-bottom: 1px solid #dbe4ef;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px clamp(12px, 2vw, 22px);
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-left {
    flex-shrink: 0;
}

.logo,
.logo a {
    display: inline-flex;
    align-items: center;
}

.logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav::-webkit-scrollbar {
    display: none;
}

.nav-item-wrapper {
    display: contents;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    transition: color 180ms ease, background-color 180ms ease;
}

.nav-link:hover {
    color: #0f172a;
    background: #eef4ff;
}

.nav-link.active {
    color: #1d4ed8;
    background: #e9f1ff;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.search-box {
    display: none;
    align-items: center;
    gap: 6px;
    height: 38px;
    min-width: 220px;
    border: 1px solid #d9e3f2;
    border-radius: 999px;
    background: #f8fbff;
    padding: 0 6px 0 8px;
}

.search-icon-btn {
    border: 0;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.search-box input {
    flex: 1;
    border: 0;
    background: transparent;
    outline: none;
    color: #334155;
    font-size: 13px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.header-search-btn,
.mobile-menu-btn,
.header-login-btn {
    border: 1px solid #d9e3f2;
    background: #ffffff;
    color: #334155;
    border-radius: 10px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.header-search-btn {
    width: 36px;
}

.header-search-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.mobile-menu-btn {
    width: 36px;
    font-size: 16px;
}

.header-login-btn {
    position: relative;
    gap: 6px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: #1d4ed8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.header-login-label {
    white-space: nowrap;
}

.header-login-indicator {
    width: 16px;
    height: 16px;
    color: currentColor;
    opacity: 0.75;
    transition: transform 160ms ease, opacity 160ms ease;
}

.header-login-btn[aria-expanded="true"] .header-login-indicator {
    transform: rotate(180deg);
    opacity: 1;
}

.header-login-cancel {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid #d7e2f2;
    color: #8a9ab4;
    background: #ffffff;
    font-size: 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 150ms ease, transform 150ms ease, border-color 150ms ease, color 150ms ease, background-color 150ms ease;
    pointer-events: none;
}

.header-login-btn.is-login-pending {
    padding-right: 10px;
}

.header-login-btn.is-login-pending:hover .header-login-cancel,
.header-login-btn.is-login-pending:focus-visible .header-login-cancel {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    border-color: #f2b3b8;
    color: #dc2626;
    background: #fff4f4;
}

.header-login-btn.is-logged-in {
    color: #0f766e;
    border-color: #b6e3da;
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
}

.auth-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 196px;
    padding: 8px;
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
    z-index: 90;
}

.auth-user-menu::before {
    content: "";
    position: absolute;
    top: -7px;
    right: 18px;
    width: 12px;
    height: 12px;
    border-top: 1px solid #dbe4ef;
    border-left: 1px solid #dbe4ef;
    background: rgba(255, 255, 255, 0.98);
    transform: rotate(45deg);
}

.auth-user-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.auth-user-menu-item {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.auth-user-menu-item:hover {
    background: #f5f9ff;
    color: #0f172a;
}

.auth-user-menu-item.danger {
    color: #b42318;
}

.auth-user-menu-item.danger:hover {
    background: #fff4f4;
    color: #b42318;
}

/* Keep desktop header clean: mobile action buttons should be hidden on desktop. */
.header-search-btn,
.mobile-menu-btn {
    display: none;
}

.header-search-btn:hover,
.mobile-menu-btn:hover,
.header-login-btn:hover {
    border-color: #bfd0ea;
    background: #f5f9ff;
}

/* Main converter card */
.page {
    min-height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: clamp(10px, 1.8vw, 18px);
}

.panel {
    width: min(100%, 620px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.9));
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(7px);
    padding: clamp(20px, 2.8vw, 30px);
    animation: panel-rise 380ms ease-out;
}

.language-switcher {
    width: min(100%, 980px);
    animation: fade-up 620ms 180ms ease-out both;
}

.user-center-page + .language-switcher {
    width: min(100%, 1160px);
}

.language-card {
    border-radius: 14px;
    border: 1px solid #dfe7f3;
    background: #ffffff;
    padding: 14px 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.language-title {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: #64748b;
}

.language-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 4px;
}

.language-link {
    border: 0;
    background: transparent;
    color: #475569;
    padding: 0 8px;
    font-size: 13px;
    line-height: 1.8;
    cursor: pointer;
}

.language-link:first-child {
    padding-left: 0;
}

.language-link + .language-link {
    border-left: 1px solid #d7e2f2;
}

.language-link:hover {
    color: #1e3a8a;
}

.language-link.is-active {
    color: #1d4ed8;
    font-weight: 600;
}

.app-head {
    animation: fade-up 380ms ease-out both;
    text-align: center;
}

.app-head-wide {
    text-align: left;
}

.app-head-wide .eyebrow {
    margin: 0;
}

.app-head h1 {
    margin: 0 0 8px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #d7e4ff;
    background: #eef4ff;
    color: #1e40af;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 auto;
}

.app-identity {
    margin: 18px auto 0;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    width: min(100%, 430px);
    text-align: left;
}

.app-mark {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #39baf4 0%, #22d3ee 100%);
    color: #ffffff;
    font-size: 34px;
    font-weight: 700;
    box-shadow: 0 18px 30px rgba(34, 211, 238, 0.28);
}

.app-copy {
    min-width: 0;
}

h1 {
    margin: 12px 0 8px;
    font-size: clamp(26px, 3.5vw, 34px);
    line-height: 1.18;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.feature-strip {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    animation: fade-up 460ms 80ms ease-out both;
}

.secondary-action-btn,
.account-history-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.secondary-action-btn {
    border: 1px solid #c9daf4;
    background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
    color: #1d4ed8;
    padding: 0 16px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.secondary-action-btn:hover,
.account-history-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.account-history-link {
    padding: 0 14px;
    border: 1px solid #f3d4bd;
    background: #fff7f0;
    color: #c2410c;
}

.secondary-action-btn.is-strong {
    border-color: #1d4ed8;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
}

.secondary-action-btn.is-danger {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%);
    color: #b42318;
}

.feature-chip {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #1e3a8a;
    background: linear-gradient(135deg, #eff5ff, #eef2ff);
    border: 1px solid #d7e4ff;
}

.feature-strip-left {
    justify-content: flex-start;
}

.feature-strip-muted {
    gap: 7px;
    margin-top: 16px;
}

.feature-strip-muted .feature-chip {
    padding: 5px 11px;
    font-size: 11px;
    background: rgba(238, 244, 255, 0.88);
}

.hero-status-board {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr 0.85fr;
    gap: 12px;
}

.hero-status-card {
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 20px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.hero-status-card-primary {
    background:
        radial-gradient(28rem 16rem at 0% 0%, rgba(37, 99, 235, 0.12), transparent 60%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.97), rgba(243, 248, 255, 0.92));
}

.hero-status-label {
    margin: 0 0 8px;
    font-size: 12px;
    color: #64748b;
}

.hero-status-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    color: #0f172a;
}

.hero-status-desc,
.hero-status-note {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: #51627d;
}

.hero-status-value {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #12315f;
    line-height: 1.2;
}

.quota-progress {
    margin-top: 12px;
    height: 10px;
    border-radius: 999px;
    background: #e5eefc;
    overflow: hidden;
}

.quota-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
    transition: width 220ms ease;
}

.converter-form {
    margin-top: 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid #e6edf8;
    background:
        linear-gradient(180deg, #ffffff, #fbfdff),
        linear-gradient(135deg, rgba(37, 99, 235, 0.03), rgba(249, 115, 22, 0.03));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: fade-up 520ms 120ms ease-out both;
}

.field {
    display: block;
    position: relative;
    z-index: 1;
    margin-bottom: 14px;
}

.field:last-of-type {
    margin-bottom: 0;
}

.field.is-select-open {
    z-index: 80;
}

.field-label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.mode-hint {
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px dashed #d2ddf5;
    background: #f8fbff;
    font-size: 13px;
    color: var(--muted);
}

.converter-form small {
    display: inline-block;
    margin-top: 7px;
    font-size: 12px;
    color: #64748b;
}

.select-shell {
    position: relative;
    z-index: 1;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(145deg, #cfe0ff 0%, #b8cefa 38%, #d6e4fb 100%);
    box-shadow:
        0 10px 22px rgba(29, 78, 216, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.select-shell::before {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    top: 1px;
    height: 40%;
    border-radius: 14px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.select-shell:hover {
    transform: translateY(-1px);
    box-shadow:
        0 14px 24px rgba(29, 78, 216, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.select-shell:focus-within {
    background: linear-gradient(145deg, #6b9dff 0%, #5c87f1 52%, #7ea8ff 100%);
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.15),
        0 14px 30px rgba(29, 78, 216, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transform: translateY(0);
}

.kq-select {
    position: relative;
}

.select-shell.is-custom-ready select {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.converter-form select,
.kq-select-trigger {
    width: 100%;
    min-height: 50px;
    border-radius: 15px;
    border: 0;
    background: linear-gradient(165deg, #ffffff 0%, #f7fbff 56%, #eef5ff 100%);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 12px 48px 12px 14px;
    appearance: none;
    -webkit-appearance: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(200, 214, 238, 0.45);
    transition: background-color 180ms ease, color 180ms ease;
}

.kq-select-trigger {
    border: 0;
    text-align: left;
    cursor: pointer;
}

.kq-select-trigger:focus-visible {
    outline: none;
}

.converter-form select:hover,
.kq-select-trigger:hover {
    background: linear-gradient(165deg, #ffffff 0%, #f1f7ff 58%, #e8f2ff 100%);
}

.converter-form select:focus {
    outline: none;
}

.select-icon {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #4f6fae;
    pointer-events: none;
    transition: transform 200ms ease, color 180ms ease;
}

.select-shell:focus-within .select-icon {
    color: #1e429f;
    transform: translateY(-50%) rotate(180deg);
}

.select-shell.is-open .select-icon {
    color: #1e429f;
    transform: translateY(-50%) rotate(180deg);
}

.select-icon svg {
    width: 17px;
    height: 17px;
    display: block;
}

.kq-select-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 55;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid #bfd0ea;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
    box-shadow:
        0 16px 32px rgba(15, 23, 42, 0.16),
        0 2px 10px rgba(29, 78, 216, 0.12);
    max-height: 228px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 170ms ease, transform 170ms ease;
}

.select-shell.is-open .kq-select-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.select-shell.is-open {
    z-index: 40;
}

.kq-select-option {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #1e293b;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease;
}

.kq-select-option:hover,
.kq-select-option:focus-visible {
    outline: none;
    background: #e9f2ff;
    color: #1d4ed8;
}

.kq-select-option.is-selected {
    background: linear-gradient(145deg, #2d66d4 0%, #2256b8 100%);
    color: #ffffff;
}

.kq-select-option[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.converter-form select option {
    font-weight: 500;
    color: #0f172a;
    background: #f5f9ff;
}

.file-upload {
    position: relative;
    border: 1px dashed #c7d6ef;
    border-radius: 14px;
    background: linear-gradient(165deg, #ffffff 0%, #f2f7ff 100%);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.file-upload:hover {
    border-color: #9bb9ef;
    transform: translateY(-1px);
}

.file-upload:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    transform: translateY(0);
}

.file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 82px;
    padding: 12px;
}

.file-upload-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #e8f1ff, #dbe9ff);
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16);
}

.file-upload-icon svg {
    width: 22px;
    height: 22px;
}

.file-upload-copy {
    min-width: 0;
}

.file-action-text {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.file-meta {
    margin: 4px 0 0;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-browse-btn {
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 92px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #c7d6ef;
    background: #ffffff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
}

.file-upload.has-file {
    border-style: solid;
    border-color: #8eb0ea;
    background: linear-gradient(165deg, #ffffff 0%, #eef5ff 100%);
}

.file-upload.has-file .file-upload-icon {
    background: linear-gradient(145deg, #d9e8ff, #c8ddff);
}

.file-upload.has-file .file-meta {
    color: #1e40af;
    font-weight: 500;
}

.actions {
    margin-top: 14px;
    animation: fade-up 580ms 160ms ease-out both;
}

.actions > button {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    background: linear-gradient(130deg, var(--primary) 0%, var(--primary-strong) 60%, #1e40af 100%);
    box-shadow: 0 16px 26px rgba(37, 99, 235, 0.28);
    transition: transform 150ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.actions > button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(37, 99, 235, 0.32);
    filter: saturate(1.04);
}

.actions > button:active {
    transform: translateY(0);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.26);
}

.actions > button:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.45);
    outline-offset: 2px;
}

.actions > button:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
    box-shadow: 0 8px 14px rgba(71, 85, 105, 0.18);
}

.actions > button.is-loading {
    background: linear-gradient(130deg, #3b82f6 0%, #1e40af 55%, #1d4ed8 100%);
}

.status {
    margin: 10px 2px 0;
    min-height: 24px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.status.pending {
    color: #92400e;
    border-color: #f3d7b2;
    background: #fff6e8;
}

.status.ok {
    color: #116a3f;
    border-color: #b8e6cc;
    background: #effcf4;
}

.status.error {
    color: #9f1239;
    border-color: #f5c8d2;
    background: #fff1f5;
}

/* Footer from external template */
.footer {
    margin-top: 26px;
    background: #0f172a;
    color: #dbe7ff;
}

.footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px clamp(12px, 2vw, 22px) 18px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.3fr repeat(3, 1fr);
    gap: 20px;
}

.footer-logo {
    width: auto;
    height: 42px;
    object-fit: contain;
}

.footer-desc {
    margin: 12px 0;
    color: #b6c8e4;
    font-size: 13px;
    line-height: 1.7;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #274369;
    background: #12203a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.footer-section h4 {
    margin: 3px 0 10px;
    color: #f8fbff;
    font-size: 15px;
}

.footer-section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-section li,
.footer-section a {
    color: #bcd0ee;
    font-size: 13px;
    line-height: 1.8;
}

.footer-section a:hover {
    color: #ffffff;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-icon-img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.footer-bottom {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #223859;
}

.copyright-links {
    margin: 0;
    color: #9fb4d4;
    font-size: 12px;
    line-height: 1.8;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.separator {
    color: #526a8d;
}

.copyright-links a {
    color: #c7daff;
}

.copyright-links a:hover {
    color: #ffffff;
}

.user-center-page {
    width: min(100%, 1360px);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 14px;
}

.user-center-page-compact {
    grid-template-columns: minmax(0, 1.92fr) minmax(280px, 0.54fr);
    align-items: start;
}

.user-center-stack {
    display: grid;
    gap: 14px;
}

.user-center-main,
.user-center-side {
    min-width: 0;
}

.user-shell {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
    border: 1px solid #dbe4ef;
    border-radius: 24px;
    box-shadow: var(--shadow-strong);
    overflow: hidden;
}

.user-shell-secondary {
    opacity: 0.96;
}

.user-hero {
    position: relative;
    padding: 24px;
    background:
        radial-gradient(36rem 20rem at 0% 0%, rgba(37, 99, 235, 0.18), transparent 65%),
        radial-gradient(28rem 16rem at 100% 0%, rgba(249, 115, 22, 0.16), transparent 60%),
        linear-gradient(135deg, #f7fbff 0%, #ffffff 100%);
}

.user-hero-tight {
    padding: 18px 18px 18px;
}

.user-hero::after {
    content: "";
    position: absolute;
    inset: auto -40px -60px auto;
    width: 180px;
    height: 180px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    filter: blur(8px);
}

.user-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.user-hero-top-compact {
    margin-top: 10px;
    align-items: flex-start;
}

.user-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.user-avatar {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.16);
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
}

.user-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: #1e40af;
}

.user-title {
    margin: 0 0 6px;
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.1;
}

.user-subtitle {
    margin: 0;
    color: #475569;
    line-height: 1.6;
    max-width: 560px;
}

.user-copy {
    min-width: 0;
}

.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #eff6ff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.vip-badge.is-free {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #334155;
}

.vip-badge-plain {
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.user-kpis {
    position: relative;
    z-index: 1;
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.user-kpis-strong {
    margin-top: 12px;
    gap: 12px;
}

.user-kpis-horizontal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
}

.hero-workbench {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(250px, 0.72fr);
    gap: 12px;
    align-items: stretch;
}

.hero-workbench-main,
.hero-workbench-side {
    display: grid;
    gap: 12px;
}

.hero-inline-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.hero-status-card-wide {
    min-height: 144px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-secondary-meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-secondary-item {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dbe4ef;
}

.hero-secondary-item strong {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.hero-secondary-item span {
    font-size: 12px;
    color: #1e293b;
    font-weight: 700;
}

.user-hero-board {
    position: relative;
    z-index: 1;
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 12px;
}

.user-hero-panel {
    border: 1px solid #dbe4ef;
    border-radius: 18px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.user-hero-panel-label {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #64748b;
    text-transform: uppercase;
}

.user-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
    font-size: 12px;
    font-weight: 600;
}

.user-hero-list {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    font-size: 13px;
    line-height: 1.7;
}

.user-hero-list li + li {
    margin-top: 6px;
}

.user-kpi {
    border: 1px solid #d9e4f5;
    border-radius: 18px;
    padding: 12px 13px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.user-kpi-focus {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 255, 0.94));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.98),
        0 14px 28px rgba(37, 99, 235, 0.08);
}

.user-kpi-label {
    margin: 0 0 8px;
    font-size: 12px;
    color: #64748b;
}

.user-kpi-value {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.user-kpi-value-hero {
    font-size: 27px;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.user-kpi-value-sm {
    font-size: 15px;
    line-height: 1.45;
}

.user-kpi-note {
    margin: 6px 0 0;
    font-size: 11px;
    color: #64748b;
}

.user-card {
    padding: 16px 18px 18px;
}

.user-card-side {
    padding: 15px 15px 16px;
}

.user-center-stack > .user-shell:last-child .inline-actions,
.user-center-stack > .user-shell:nth-last-child(1) .inline-actions {
    justify-content: stretch;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-head-side {
    margin-bottom: 14px;
}

.section-head-gapless {
    margin-bottom: 12px;
}

.section-title {
    margin: 0;
    font-size: 17px;
}

.section-desc {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 12px;
}

.pill-note {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
}

.quota-grid,
.user-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.user-meta-grid-side,
.quota-grid-soft {
    gap: 10px;
}

.quota-item,
.user-meta-item {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 14px 16px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.user-meta-grid-side .user-meta-item {
    border-radius: 16px;
    padding: 11px 12px;
}

.quota-item strong,
.user-meta-item strong {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
}

.quota-item span,
.user-meta-item span {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
}

.user-meta-grid-side .user-meta-item span {
    font-size: 15px;
    line-height: 1.3;
}

.user-meta-grid-side .user-meta-item:nth-child(5) span {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.records-table-wrap {
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
    max-height: 230px;
}

.record-summary-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.record-summary-item {
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.record-summary-item strong {
    display: block;
    margin-bottom: 10px;
    font-size: 12px;
    color: #64748b;
}

.record-summary-item span {
    display: block;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.mode-hint {
    margin: 0 0 10px;
    padding: 9px 11px;
    border-radius: 12px;
    border: 1px solid #dbe7fb;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    font-size: 12px;
    color: #3f5578;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.records-table th,
.records-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: top;
    font-size: 12px;
}

.records-table td:nth-child(4),
.records-table td:nth-child(5),
.records-table th:nth-child(4),
.records-table th:nth-child(5) {
    width: 132px;
}

.records-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fbff;
    color: #475569;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.records-table tbody tr {
    transition: background-color 160ms ease;
}

.records-table tbody tr:hover {
    background: #fbfdff;
}

.records-table tr:last-child td {
    border-bottom: 0;
}

.record-file {
    font-weight: 600;
    color: #0f172a;
    font-size: 13px;
}

.record-meta {
    margin-top: 4px;
    color: #64748b;
    line-height: 1.4;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-chip.is-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #047857;
}

.status-chip.is-processing {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    color: #c2410c;
}

.status-chip.is-failed {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #b91c1c;
}

.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    padding: 26px 18px;
    text-align: center;
    color: #64748b;
    background: linear-gradient(180deg, #fbfdff 0%, #f8fbff 100%);
}

.inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-actions > * {
    flex: 1 1 160px;
}

.inline-actions-compact > * {
    flex: 0 0 auto;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.action-grid > * {
    min-width: 0;
}

.action-grid-full {
    grid-column: 1 / -1;
}

.ghost-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid #d7e2f2;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.ghost-link:hover {
    border-color: #bfd0ea;
    background: #f5f9ff;
}

.ghost-link.is-soft {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.user-action-grid {
    margin-top: 2px;
}

.action-grid-side {
    grid-template-columns: 1fr;
}

.action-grid-side .secondary-action-btn {
    min-height: 44px;
    font-size: 14px;
}

.action-grid-side .secondary-action-btn.is-danger {
    background: linear-gradient(135deg, #fff7f7 0%, #ffe0e0 100%);
}

.side-action-panel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e6edf8;
}

.side-advice-panel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e6edf8;
}

.side-advice-list {
    display: grid;
    gap: 8px;
}

.side-advice-item {
    padding: 10px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.side-advice-item strong {
    display: block;
    margin-bottom: 7px;
    font-size: 11px;
    color: #64748b;
}

.side-advice-item span {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: #0f172a;
}

.user-shell-sticky {
    position: sticky;
    top: 66px;
}

@media (max-width: 1024px) {
    .search-box {
        min-width: 180px;
    }

    .footer-content {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-center-page {
        grid-template-columns: 1fr;
    }

    .user-shell-sticky {
        position: static;
    }

    .hero-workbench {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        gap: 10px;
        padding-top: max(10px, env(safe-area-inset-top));
    }

    .header-left {
        order: 1;
    }

    .header-right {
        order: 2;
        margin-left: auto;
    }

    .search-box {
        display: none;
    }

    .header-search-btn,
    .mobile-menu-btn {
        display: none;
    }

    .header-login-btn {
        display: inline-flex;
        max-width: min(62vw, 220px);
    }

    .header-login-btn.is-login-pending .header-login-cancel {
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }

    .nav {
        order: 3;
        width: 100%;
        padding-bottom: 2px;
    }

    .nav-link {
        height: 34px;
        font-size: 13px;
        padding: 0 10px;
    }

    .page {
        align-items: start;
        min-height: auto;
        padding: 10px;
    }

    .panel {
        border-radius: 18px;
        padding: 14px;
    }

    .app-identity {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .app-copy {
        text-align: center;
    }

    .feature-strip {
        gap: 7px;
    }

    .user-center-page {
        grid-template-columns: 1fr;
    }

    .user-kpis,
    .hero-status-board,
    .user-hero-board,
    .quota-grid,
    .user-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-inline-metrics,
    .user-kpis-horizontal {
        grid-template-columns: 1fr;
    }

    .record-summary-strip {
        grid-template-columns: 1fr;
    }

    .converter-form select,
    .kq-select-trigger {
        min-height: 50px;
        font-size: 16px;
    }

    .file-upload-main {
        grid-template-columns: auto 1fr;
        row-gap: 10px;
    }

    .inline-actions > * {
        flex-basis: 100%;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .user-kpi-value-hero {
        font-size: 26px;
    }

    .file-browse-btn {
        grid-column: 1 / -1;
        width: 100%;
        justify-self: stretch;
        height: 38px;
    }

    .actions {
        position: sticky;
        bottom: 0;
        margin: 10px -14px -14px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: linear-gradient(
            to top,
            rgba(255, 255, 255, 0.96) 72%,
            rgba(255, 255, 255, 0.74) 100%
        );
        border-top: 1px solid #e6edf8;
        backdrop-filter: blur(7px);
    }

    .status {
        margin-top: 8px;
    }

    .footer {
        margin-top: 16px;
    }

    .footer .container {
        padding-top: 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .language-card {
        padding: 12px;
    }

    .language-link {
        font-size: 12px;
        line-height: 1.7;
        padding: 0 7px;
    }
}

@media (max-width: 420px) {
    .user-hero {
        padding: 18px;
    }

    .auth-user-menu {
        min-width: 168px;
    }

    .user-hero-top,
    .user-identity {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-mark {
        width: 58px;
        height: 58px;
        border-radius: 18px;
        font-size: 30px;
    }

    .user-kpis,
    .hero-status-board,
    .user-hero-board,
    .quota-grid,
    .user-meta-grid {
        grid-template-columns: 1fr;
    }

    .hero-inline-metrics,
    .user-kpis-horizontal {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 24px;
    }

    .feature-chip {
        font-size: 11px;
        padding: 5px 10px;
    }

    .converter-form {
        padding: 12px;
    }

    .mobile-menu-btn,
    .header-search-btn {
        width: 34px;
        height: 34px;
    }
}

@keyframes panel-rise {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes select-menu-reveal {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-strip-compact {
    margin-top: 10px;
    gap: 6px;
}

.feature-strip-muted {
    gap: 6px;
    margin-top: 10px;
}

.hero-status-card-slim {
    min-height: 122px;
}

.hero-status-tags {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hero-mini-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #dbe4ef;
    color: #274472;
    font-size: 11px;
    font-weight: 700;
}

.mini-progress {
    margin-top: 10px;
    height: 8px;
    border-radius: 999px;
    background: #edf3ff;
    overflow: hidden;
}

.mini-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
    transition: width 220ms ease;
}

.user-kpi-visual .user-kpi-note {
    display: none;
}

.status-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.status-panel-item {
    padding: 11px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.status-panel-item strong {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    color: #64748b;
}

.status-panel-item span {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
}

.status-inline-bar {
    margin-top: 10px;
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
}

.status-inline-bar.is-success {
    background: linear-gradient(90deg, #22c55e 0%, #86efac 100%);
}

.status-inline-bar.is-failed {
    background: linear-gradient(90deg, #ef4444 0%, #fca5a5 100%);
}

.status-inline-bar.is-processing {
    background: linear-gradient(90deg, #f59e0b 0%, #fcd34d 100%);
}

.empty-state {
    padding: 20px 14px;
}
