/* static/css/modern_common_style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Light Theme Variables - Professional & Clean */
    --bg-primary-light: #f4f6f8;
    /* Very light gray, almost white */
    --bg-secondary-light: #ffffff;
    /* Card background, pure white for contrast */
    --bg-tertiary-light: #e9ecef;
    /* Input fields, subtle dividers */
    --text-primary-light: #212529;
    /* Dark gray for primary text */
    --text-secondary-light: #495057;
    /* Medium gray for secondary text */
    --text-muted-light: #6c757d;
    /* Lighter gray for less important text */
    --accent-primary-light: #007bff;
    /* Classic blue for primary actions */
    --accent-secondary-light: #0056b3;
    /* Darker blue for hover/active */
    --border-color-light: #dee2e6;
    /* Standard border color */
    --card-shadow-light: 0 2px 4px rgba(0, 0, 0, 0.05), 0 5px 15px rgba(0, 0, 0, 0.05);
    /* Softer, layered shadow */
    --success-light: #28a745;
    --error-light: #dc3545;
    --warning-light: #ffc107;
    --info-light: #17a2b8;
    --disabled-bg-light: #f1f3f5;
    --disabled-text-light: #adb5bd;

    /* Dark Theme Variables - Modern, Deep & Accessible */
    --bg-primary-dark: #0d1117;
    /* GitHub-like deep dark blue/gray */
    --bg-secondary-dark: #161b22;
    /* Card background, slightly lighter */
    --bg-tertiary-dark: #21262d;
    /* Input fields, borders in dark mode */
    --text-primary-dark: #c9d1d9;
    /* Light gray/off-white for primary text */
    --text-secondary-dark: #8b949e;
    /* Medium gray for secondary text */
    --text-muted-dark: #586069;
    /* Darker gray for muted text */
    --accent-primary-dark: #58a6ff;
    /* Brighter blue for dark mode actions */
    --accent-secondary-dark: #1f6feb;
    /* Slightly different hover for dark blue */
    --border-color-dark: #30363d;
    /* Border color that matches tertiary bg or slightly darker */
    --card-shadow-dark: 0 2px 8px rgba(0, 0, 0, 0.2), 0 5px 20px rgba(0, 0, 0, 0.15);
    /* Subtle shadow for dark */
    --success-dark: #3fb950;
    --error-dark: #f85149;
    --warning-dark: #d29922;
    --info-dark: #388bfd;
    --disabled-bg-dark: #21262d;
    --disabled-text-dark: #484f58;

    /* Common Variables */
    --card-border-radius: 10px;
    --button-border-radius: 6px;
    --input-border-radius: 6px;
    --transition-fast: 0.15s ease-in-out;
    --transition-smooth: 0.25s ease-in-out;
}

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

html {
    font-size: 16px;
    min-height: 100%;
    background-color: var(--bg-primary-light);
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary-light);
    /* Applied to body */
    color: var(--text-primary-light);
    /* Applied to body */
    line-height: 1.6;
    padding: calc(20px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body.no-scroll {
    overflow: hidden;
}

/* Dark mode styles applied when html has data-theme="dark" */
html[data-theme="dark"] {
    background-color: var(--bg-primary-dark);
    /* Ensure html background is dark too */
    color: var(--text-primary-dark);
}

html[data-theme="dark"] body {
    /* Make body inherit from html in dark mode */
    background-color: inherit;
    color: inherit;
}

/* Apply dark theme variables to specific elements when data-theme="dark" is on HTML */
html[data-theme="dark"] header h1 {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] header p.subtitle {
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] .card {
    background-color: var(--bg-secondary-dark);
    border-color: var(--border-color-dark);
    box-shadow: var(--card-shadow-dark);
}

html[data-theme="dark"] .card.glass {
    /* Dark Glassmorphism if used */
    background: rgba(30, 30, 30, 0.75);
    /* Slightly more opaque */
    border: 1px solid var(--border-color-dark);
    box-shadow: var(--card-shadow-dark);
    /* Can be same or adjusted */
}

html[data-theme="dark"] .card h2 {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] label {
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background-color: var(--bg-tertiary-dark);
    color: var(--text-primary-dark);
    border-color: var(--border-color-dark);
}

html[data-theme="dark"] input[type="text"]::placeholder,
html[data-theme="dark"] input[type="password"]::placeholder {
    color: var(--text-muted-dark);
}

html[data-theme="dark"] input[type="text"]:focus,
html[data-theme="dark"] input[type="password"]:focus,
html[data-theme="dark"] input[type="datetime-local"]:focus,
html[data-theme="dark"] input[type="date"]:focus,
html[data-theme="dark"] input[type="number"]:focus,
html[data-theme="dark"] input[type="email"]:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
    border-color: var(--accent-primary-dark);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.25);
    /* Adjusted focus ring for dark */
    background-color: var(--bg-secondary-dark);
    /* Can keep it same or slightly different */
}

/* Fix for datetime-local icon color in dark mode */
html[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}


html[data-theme="dark"] button {
    background-color: var(--accent-primary-dark);
    color: var(--bg-primary-dark);
    /* High contrast text on button */
}

html[data-theme="dark"] button:hover {
    background-color: var(--accent-secondary-dark);
}

html[data-theme="dark"] button:disabled {
    background-color: var(--disabled-bg-dark);
    color: var(--disabled-text-dark);
}

html[data-theme="dark"] .button-secondary {
    background-color: transparent;
    /* More subtle secondary button */
    color: var(--accent-primary-dark);
    border: 1px solid var(--accent-primary-dark);
}

html[data-theme="dark"] .button-secondary:hover {
    background-color: rgba(88, 166, 255, 0.1);
    /* Slight background on hover */
    color: var(--accent-primary-dark);
    /* Keep text color */
}

html[data-theme="dark"] .button-danger {
    background-color: var(--error-dark);
    color: var(--bg-primary-dark);
}

html[data-theme="dark"] .button-danger:hover {
    background-color: #d9363e;
}

/* Darken from --error-dark */

html[data-theme="dark"] .message.success {
    background-color: rgba(63, 185, 80, 0.15);
    color: var(--success-dark);
    border-color: rgba(63, 185, 80, 0.3);
}

html[data-theme="dark"] .message.error {
    background-color: rgba(248, 81, 73, 0.15);
    color: var(--error-dark);
    border-color: rgba(248, 81, 73, 0.3);
}

html[data-theme="dark"] .message.info {
    background-color: rgba(56, 139, 253, 0.15);
    color: var(--info-dark);
    border-color: rgba(56, 139, 253, 0.3);
}

html[data-theme="dark"] .message.warning {
    background-color: rgba(210, 153, 34, 0.15);
    color: var(--warning-dark);
    border-color: rgba(210, 153, 34, 0.3);
}

html[data-theme="dark"] .theme-switch-button {
    background-color: var(--bg-tertiary-dark);
}

html[data-theme="dark"] .theme-switch-button:hover {
    background-color: var(--border-color-dark);
}

html[data-theme="dark"] .input-group input:focus+button {
    border-left-color: var(--accent-primary-dark);
}

/* Adjust for dark */
html[data-theme="dark"] #qrCodeImage {
    border-color: var(--border-color-dark);
}

html[data-theme="dark"] table {
    border-color: var(--border-color-dark);
}

html[data-theme="dark"] th,
html[data-theme="dark"] td {
    border-bottom-color: var(--border-color-dark);
}

html[data-theme="dark"] th {
    background-color: var(--bg-tertiary-dark);
    color: var(--text-primary-dark);
}

html[data-theme="dark"] .status-active {
    color: var(--success-dark);
}

html[data-theme="dark"] .status-disabled {
    color: var(--disabled-text-dark);
}

html[data-theme="dark"] .status-expired {
    color: var(--error-dark);
}

    html[data-theme="dark"] .loader {
        border-color: var(--bg-tertiary-dark);
        border-top-color: var(--accent-primary-dark);
    }

    html[data-theme="dark"] .input-group input {
        border-right-color: var(--border-color-dark);
    }

/* Key Status Styling */
.key-status.valid {
    color: var(--success-light);
    font-weight: 600;
}

html[data-theme="dark"] .key-status.valid {
    color: var(--success-dark);
}

.key-status.expired,
.key-status.invalid {
    color: var(--error-light);
    font-weight: 600;
}

html[data-theme="dark"] .key-status.expired,
html[data-theme="dark"] .key-status.invalid {
    color: var(--error-dark);
}

.key-status.disabled {
    color: var(--disabled-text-light);
    font-weight: 600;
}

html[data-theme="dark"] .key-status.disabled {
    color: #94a3b8;
}

.key-status.unknown {
    color: var(--text-muted-light);
    font-style: italic;
}

html[data-theme="dark"] .key-status.unknown {
    color: var(--text-muted-dark);
}

/* Countdown Tag Styling */
.countdown-tag {
    display: inline-block;
    padding: 3px 8px;
    margin-left: 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: rgba(0, 123, 255, 0.1); /* Light blue background */
    color: var(--accent-primary-light);
    border: 1px solid rgba(0, 123, 255, 0.3);
    white-space: nowrap;
}

html[data-theme="dark"] .countdown-tag {
    background-color: rgba(88, 166, 255, 0.1);
    color: var(--accent-primary-dark);
    border-color: rgba(88, 166, 255, 0.3);
}

/* Key Note Styling */
.key-note-style {
    display: inline-block;
    padding: 5px 10px;
    background-color: var(--bg-tertiary-light);
    border-radius: var(--input-border-radius);
    font-style: italic;
    color: var(--text-secondary-light);
    word-break: break-word; /* Ensure long notes wrap */
    max-width: 100%; /* Ensure it doesn't overflow */
}

html[data-theme="dark"] .key-note-style {
    background-color: var(--bg-tertiary-dark);
    color: var(--text-secondary-dark);
}

/* Key Info Item Styling */
.key-info-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    margin-bottom: 5px; /* Space between items */
    background-color: var(--bg-tertiary-light);
    border-radius: var(--input-border-radius);
    border: 1px solid var(--border-color-light);
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

html[data-theme="dark"] .key-info-item {
    background-color: var(--bg-tertiary-dark);
    border-color: var(--border-color-dark);
}

.key-info-item:last-child {
    margin-bottom: 0;
}

.key-info-label {
    font-weight: 500;
    color: var(--text-secondary-light);
    margin-right: 10px;
    white-space: nowrap; /* Prevent label from wrapping */
}

html[data-theme="dark"] .key-info-label {
    color: var(--text-secondary-dark);
}

/* Adjust key-note-style to fit within key-info-item */
.key-note-style {
    flex-grow: 1; /* Allow it to take remaining space */
    padding: 0; /* Remove padding as it's now on the parent */
    background-color: transparent; /* Remove background as it's on the parent */
    border-radius: 0; /* Remove border-radius */
    font-style: italic;
    color: var(--text-primary-light); /* Use primary text color for content */
    word-break: break-word;
    max-width: none; /* Remove max-width constraint */
}

html[data-theme="dark"] .key-note-style {
    background-color: transparent;
    color: var(--text-primary-dark);
}

/* Specific style for the note item to apply the background/border to the whole row */
.key-note-item-note {
    background-color: var(--bg-tertiary-light);
    border: 1px solid var(--border-color-light);
    border-radius: var(--input-border-radius);
    padding: 8px 15px; /* Match other key-info-item padding */
}

html[data-theme="dark"] .key-note-item-note {
    background-color: var(--bg-tertiary-dark);
    border-color: var(--border-color-dark);
}

/* Styles for copyable key cells */
.copyable-key {
    font-family: monospace;
    color: var(--accent-primary-light); /* Make it look like a link */
    text-decoration: underline;
    cursor: pointer;
    word-break: break-all; /* Ensure long keys wrap */
}

html[data-theme="dark"] .copyable-key {
    color: var(--accent-primary-dark);
}

.copyable-key:hover {
    opacity: 0.8;
}

.key-cell-content {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    vertical-align: middle;
}

.key-cell-text {
    min-width: 0;
    word-break: break-all;
}

.key-running-indicator {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.34);
    animation: spin 0.9s linear infinite;
}

html[data-theme="dark"] .key-running-indicator {
    border-color: rgba(125, 211, 252, 0.22);
    border-top-color: #7dd3fc;
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.48);
}

.copyable-key-header {
    /* Optional: style for the header of the copyable key column */
    /* For example, to add a subtle icon or different text style */
}

.key-note-cell {
    max-width: 220px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-secondary-light);
    white-space: normal;
    word-break: break-word;
}

html[data-theme="dark"] .key-note-cell {
    color: var(--text-secondary-dark);
}


.container {
    width: 100%;
    max-width: 1800px;
    margin: auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary-light);
    margin-bottom: 8px;
}

header p.subtitle {
    font-size: 1rem;
    color: var(--text-muted-light);
}

.card {
    background-color: var(--bg-secondary-light);
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow-light);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color-light);
    transition: background-color var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary-light);
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary-light);
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
input[type="date"],
input[type="number"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color-light);
    border-radius: var(--input-border-radius);
    background-color: var(--bg-tertiary-light);
    color: var(--text-primary-light);
    font-size: 16px;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-primary-light);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
    background-color: var(--bg-secondary-light);
}

input.is-loading {
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 123, 255, 0.18) 45%,
        transparent 90%
    );
    background-size: 220% 100%;
    animation: inputLoading 1.1s linear infinite;
}

html[data-theme="dark"] input.is-loading {
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(88, 166, 255, 0.2) 45%,
        transparent 90%
    );
}

@keyframes inputLoading {
    0% {
        background-position: 120% 0;
    }

    100% {
        background-position: -120% 0;
    }
}

button {
    padding: 10px 18px;
    background-color: var(--accent-primary-light);
    color: white;
    border: none;
    border-radius: var(--button-border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

button:hover {
    background-color: var(--accent-secondary-light);
    box-shadow: 0 1px 3px rgba(0, 122, 255, 0.15);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0px);
    box-shadow: none;
}

button:disabled {
    background-color: var(--disabled-bg-light);
    color: var(--disabled-text-light);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.button-secondary {
    background-color: var(--bg-secondary-light);
    color: var(--accent-primary-light);
    border: 1px solid var(--border-color-light);
    /* Lighter border for secondary */
}

.button-secondary:hover {
    background-color: var(--bg-tertiary-light);
    color: var(--accent-secondary-light);
    border-color: var(--accent-primary-light);
    /* Highlight border on hover */
}

.button-danger {
    background-color: var(--error-light);
}

.button-danger:hover {
    background-color: #c82333;
}

.message {
    padding: 10px 15px;
    margin-top: 15px;
    margin-bottom: 15px;
    border-radius: var(--input-border-radius);
    font-size: 0.875rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message.success {
    background-color: #e6f7ec;
    color: #0f5132;
    border-color: #badbcc;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.message.info {
    background-color: #cce5ff;
    color: #004085;
    border-color: #b8daff;
}

.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.theme-switch-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-secondary-light);
    border: 1px solid var(--border-color-light);
    box-shadow: var(--card-shadow-light);
    color: var(--text-secondary-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    z-index: 1000;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.theme-switch-button:hover {
    background-color: var(--bg-tertiary-light);
    transform: scale(1.1);
}

.theme-switch-button.is-in-running-task-banner {
    position: static;
    top: auto;
    right: auto;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0;
    z-index: auto;
}

.icon-lib {
    display: block;
    flex-shrink: 0;
}

.theme-icon {
    width: 18px;
    height: 18px;
}

.theme-icon-sun {
    display: block;
}

.theme-icon-moon {
    display: none;
}

.theme-icon-auto {
    display: none;
}

html[data-theme="dark"] .theme-icon-sun {
    display: none;
}

html[data-theme="dark"] .theme-icon-moon {
    display: block;
}

html[data-theme-mode="auto"] .theme-icon-sun,
html[data-theme-mode="auto"] .theme-icon-moon {
    display: none;
}

html[data-theme-mode="auto"] .theme-icon-auto {
    display: block;
}

html[data-theme="dark"] .theme-switch-button {
    color: var(--text-secondary-dark);
}

.theme-switch-button:hover {
    color: var(--text-primary-light);
}

html[data-theme="dark"] .theme-switch-button:hover {
    color: var(--text-primary-dark);
}


.input-group {
    display: flex;
    margin-bottom: 15px;
}

.input-group input {
    flex-grow: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
    border-right: none;
}

.input-group button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    width:150px;
}

.input-group input:focus+button {
    border-left-color: var(--accent-primary-light);
    z-index: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.user-entry-page {
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(34px + env(safe-area-inset-top)) calc(22px + env(safe-area-inset-right)) calc(44px + env(safe-area-inset-bottom)) calc(22px + env(safe-area-inset-left));
    background:
        radial-gradient(circle at 79% 12%, rgba(92, 151, 255, 0.18), transparent 22%),
        radial-gradient(circle at 62% 34%, rgba(250, 107, 171, 0.13), transparent 18%),
        linear-gradient(111deg, #fbfcff 0%, #f9f7ff 38%, #f3f7ff 74%, #f8fbff 100%);
}

.user-entry-page .theme-switch-button {
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(180, 190, 225, 0.35);
    box-shadow: 0 12px 28px rgba(78, 98, 150, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.user-entry-page .container {
    width: 100%;
    max-width: 655px;
    margin: 0 auto;
    padding: 0;
}

.running-task-banner {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top));
    left: 50%;
    z-index: 1500;
    width: min(520px, calc(100vw - 132px));
    min-height: 68px;
    padding: 0 22px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.28));
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow:
        0 18px 38px rgba(45, 86, 160, 0.12),
        inset 0 7px 15px rgba(255, 255, 255, 0.92),
        inset 0 -4px 10px rgba(255, 255, 255, 0.36);
    color: #2f6fe8;
    font-size: 1.04rem;
    font-weight: 650;
    letter-spacing: 0;
    backdrop-filter: blur(24px) saturate(120%);
    -webkit-backdrop-filter: blur(24px) saturate(120%);
}

.running-task-spinner-wrapper {
    position: relative;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.running-task-spinner-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    background: #3b82f6;
    transform: translate(-50%, -50%) rotate(45deg);
    filter: blur(9px);
    opacity: 0.32;
}

.running-task-spinner-svg {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    animation: spin 1.55s linear infinite;
}

.running-task-spinner-track,
.running-task-spinner-progress {
    fill: none;
    stroke-width: 5;
}

.running-task-spinner-track {
    stroke: rgba(23, 37, 84, 0.08);
}

.running-task-spinner-progress {
    stroke: #3b82f6;
    stroke-linecap: round;
    stroke-dasharray: 90;
}

.running-task-banner-text {
    white-space: nowrap;
}

.running-task-log-button {
    min-width: 132px;
    height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42));
    color: #2f6fe8;
    box-shadow:
        inset 0 3px 6px rgba(255, 255, 255, 0.95),
        inset 0 -2px 4px rgba(15, 23, 42, 0.05),
        0 5px 12px rgba(59, 130, 246, 0.12);
    font-size: 0.98rem;
    font-weight: 650;
    letter-spacing: 0;
    cursor: pointer;
    transition: transform var(--transition-fast), opacity var(--transition-fast), box-shadow var(--transition-fast);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.running-task-log-button svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.running-task-log-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        inset 0 3px 6px rgba(255, 255, 255, 0.95),
        inset 0 -2px 4px rgba(15, 23, 42, 0.05),
        0 7px 16px rgba(59, 130, 246, 0.18);
}

.running-task-log-button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

html[data-theme="dark"] .running-task-banner {
    background: linear-gradient(135deg, rgba(30, 38, 56, 0.58), rgba(15, 20, 30, 0.34));
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow:
        0 18px 38px rgba(0, 0, 0, 0.68),
        0 10px 28px rgba(58, 130, 247, 0.12),
        inset 0 6px 12px rgba(255, 255, 255, 0.14),
        inset 0 -6px 12px rgba(0, 0, 0, 0.54);
    color: #dbeafe;
}

html[data-theme="dark"] .running-task-spinner-wrapper::before {
    opacity: 0.82;
}

html[data-theme="dark"] .running-task-spinner-track {
    stroke: rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .running-task-spinner-progress {
    stroke: #7dd3fc;
}

html[data-theme="dark"] .running-task-log-button {
    background: linear-gradient(135deg, rgba(40, 50, 70, 0.5), rgba(20, 25, 35, 0.28));
    border-color: rgba(255, 255, 255, 0.1);
    color: #dbeafe;
    box-shadow:
        inset 0 2px 5px rgba(255, 255, 255, 0.12),
        inset 0 -3px 6px rgba(0, 0, 0, 0.52),
        0 5px 14px rgba(0, 0, 0, 0.36);
}

@media (max-width: 520px) {
    .running-task-banner {
        top: calc(10px + env(safe-area-inset-top));
        width: calc(100vw - 32px);
        min-height: 62px;
        padding: 0 14px;
        gap: 9px;
        font-size: 0.94rem;
    }

    .running-task-spinner-wrapper {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .running-task-spinner-svg {
        width: 30px;
        height: 30px;
    }

    .running-task-log-button {
        min-width: 104px;
        height: 40px;
        padding: 0 12px;
        margin-right: -30px;
        gap: 6px;
        font-size: 0.9rem;
    }

    .theme-switch-button.is-in-running-task-banner {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        padding: 0;
    }

    .running-task-log-button svg {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }
}

.user-login-hero {
    position: relative;
    width: 100%;
    max-width: 655px;
    min-height: 276px;
    margin: 0 auto 14px;
    padding: 13px 10px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 266px;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.user-login-hero-copy {
    position: relative;
    z-index: 2;
    padding-top: 2px;
}

.user-login-hero h1 {
    margin: 0;
    color: #151b2d;
    font-size: 40px;
    font-weight: 800;
    line-height: 1.33;
    letter-spacing: 0;
}

.user-login-hero h1 span {
    color: #6c77ff;
    background: linear-gradient(100deg, #8062ff 0%, #6a83ff 52%, #44a0ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-login-hero .subtitle {
    margin: 22px 0 0;
    color: #5f687a;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.65;
}

.user-login-benefits {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-top: 27px;
    color: #7e8798;
}

.user-login-benefit {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    font-size: 16px;
    font-weight: 650;
    white-space: nowrap;
}

.user-login-benefit svg {
    width: 20px;
    height: 20px;
    color: #8d84ff;
    filter: drop-shadow(0 4px 8px rgba(117, 105, 255, 0.18));
}

.user-login-hero-art {
    position: relative;
    height: 250px;
    transform: translate(2px, 2px);
}

.hero-trash {
    position: absolute;
    right: 32px;
    bottom: 15px;
    width: 139px;
    height: 157px;
    filter: drop-shadow(0 28px 38px rgba(78, 87, 190, 0.22));
}

.hero-trash-lip {
    position: absolute;
    top: 16px;
    left: -11px;
    width: 161px;
    height: 44px;
    border-radius: 18px 18px 25px 25px;
    background: linear-gradient(180deg, #94a3ff 0%, #7e84f3 100%);
    box-shadow: inset 0 6px 10px rgba(255, 255, 255, 0.3), inset 0 -5px 10px rgba(76, 70, 190, 0.16);
}

.hero-trash-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 124px;
    border-radius: 20px 20px 28px 28px;
    background: linear-gradient(180deg, #8e94ff 0%, #7476e9 100%);
    box-shadow: inset 0 8px 18px rgba(255, 255, 255, 0.18);
}

.hero-trash-body span {
    position: absolute;
    top: 44px;
    width: 14px;
    height: 71px;
    border-radius: 999px;
    background: linear-gradient(180deg, #676ee2 0%, #595fd1 100%);
    box-shadow: inset 0 4px 7px rgba(41, 45, 135, 0.18);
}

.hero-trash-body span:nth-child(1) {
    left: 28px;
}

.hero-trash-body span:nth-child(2) {
    left: 63px;
}

.hero-trash-body span:nth-child(3) {
    right: 28px;
}

.hero-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 16px 35px rgba(86, 93, 175, 0.16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hero-card-weibo {
    top: -22px;
    left: 23px;
    width: 88px;
    height: 86px;
    border-radius: 14px;
    transform: rotate(8deg);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.hero-card-weibo svg {
    width: 56px;
    height: 56px;
}

.hero-card-weibo img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.hero-card-chat {
    top: -18px;
    left: -70px;
    width: 46px;
    height: 38px;
    border-radius: 13px;
    transform: rotate(-18deg);
}

.hero-card-chat::after {
    content: "";
    position: absolute;
    right: 8px;
    bottom: -7px;
    border-width: 8px 2px 0 10px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.76) transparent transparent transparent;
}

.hero-card-chat span,
.hero-bubble span {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(132, 141, 255, 0.46);
}

.hero-card-chat span:nth-child(1) {
    left: 14px;
    top: 15px;
}

.hero-card-chat span:nth-child(2) {
    left: 27px;
    top: 13px;
}

.hero-bubble {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(145deg, #9cc9ff 0%, #4f8df2 100%);
    box-shadow: 0 14px 28px rgba(82, 141, 242, 0.25), inset 0 7px 10px rgba(255, 255, 255, 0.28);
}

.hero-bubble::after {
    content: "";
    position: absolute;
    right: 8px;
    bottom: -2px;
    width: 16px;
    height: 13px;
    border-radius: 2px 0 12px 2px;
    background: #5795f4;
    transform: rotate(-32deg);
}

.hero-bubble-large {
    top: 5px;
    right: 4px;
    width: 51px;
    height: 51px;
}

.hero-bubble-large span:nth-child(1) {
    left: 14px;
    top: 24px;
}

.hero-bubble-large span:nth-child(2) {
    left: 25px;
    top: 21px;
}

.hero-bubble-large span:nth-child(3) {
    left: 36px;
    top: 25px;
}

.hero-bubble-small {
    right: 1px;
    bottom: 40px;
    width: 33px;
    height: 33px;
    opacity: 0.45;
    transform: rotate(19deg);
}

.hero-bubble-small span:nth-child(1) {
    left: 10px;
    top: 15px;
}

.hero-bubble-small span:nth-child(2) {
    left: 20px;
    top: 13px;
}

.hero-float {
    position: absolute;
    filter: drop-shadow(0 11px 18px rgba(90, 92, 190, 0.15));
}

.hero-heart {
    width: 24px;
    height: 24px;
    transform: rotate(45deg);
    border-radius: 7px 7px 3px 7px;
    background: linear-gradient(135deg, #ffb9d0, #f178a9);
}

.hero-heart::before,
.hero-heart::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: inherit;
}

.hero-heart::before {
    left: -10px;
    top: 0;
}

.hero-heart::after {
    left: 0;
    top: -10px;
}

.hero-heart-left {
    left: -21px;
    top: 158px;
}

.hero-heart-right {
    right: -18px;
    top: 119px;
    width: 20px;
    height: 20px;
    opacity: 0.78;
}

.hero-heart-right::before,
.hero-heart-right::after {
    width: 20px;
    height: 20px;
}

.hero-sparkle {
    width: 16px;
    height: 16px;
    color: #c9caff;
}

.hero-sparkle::before,
.hero-sparkle::after {
    content: "";
    position: absolute;
    inset: 7px 0;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.hero-sparkle::after {
    transform: rotate(90deg);
}

.hero-sparkle-left {
    left: -34px;
    top: 112px;
}

.hero-sparkle-right {
    right: 27px;
    bottom: 21px;
    opacity: 0.55;
}

.key-entry-card.card {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 25px;
    padding: 25px 24px 23px;
    border: 0;
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 45px rgba(70, 84, 126, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.key-entry-card h2 {
    margin: 0 0 6px;
    color: #182033;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.3;
}

.key-entry-subtitle {
    margin: 0 0 20px;
    color: #70788a;
    font-size: 17px;
    font-weight: 500;
}

.key-input-shell {
    position: relative;
    display: flex;
    align-items: center;
    height: 55px;
    margin-bottom: 14px;
    padding: 0 18px;
    border: 1px solid rgba(144, 151, 210, 0.25);
    border-radius: 28px;
    background: #f8faff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 22px rgba(98, 119, 191, 0.06);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.key-input-shell:focus-within {
    border-color: rgba(111, 110, 255, 0.62);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(116, 104, 255, 0.1), 0 12px 26px rgba(98, 119, 191, 0.09);
}

.key-input-shell svg {
    width: 22px;
    height: 22px;
    margin-right: 10px;
    color: #8588f9;
    flex: 0 0 auto;
}

.key-input-shell input[type="text"] {
    height: 100%;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #192033;
    font-size: 16px;
    font-weight: 600;
    box-shadow: none;
}

.key-input-shell input[type="text"]::placeholder {
    color: #a0a7ba;
    font-weight: 500;
}

.key-input-shell input[type="text"]:focus {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.weibo-login-button {
    width: 100%;
    min-height: 60px;
    padding: 0 28px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(100deg, #7655f5 0%, #7165f6 41%, #5196f4 100%);
    color: #ffffff;
    font-size: 20px;
    font-weight: 750;
    white-space: nowrap;
    box-shadow: 0 13px 24px rgba(83, 111, 233, 0.27);
}

.weibo-login-button span {
    white-space: nowrap;
}

.weibo-login-button:hover {
    background: linear-gradient(100deg, #6e4bed 0%, #6860ef 41%, #4389eb 100%);
    box-shadow: 0 16px 30px rgba(83, 111, 233, 0.31);
    transform: translateY(-1px);
}

.weibo-login-button:disabled {
    background: linear-gradient(100deg, #b7b0ef 0%, #aeb7f0 48%, #9fc4ef 100%);
    color: rgba(255, 255, 255, 0.86);
    box-shadow: 0 10px 22px rgba(107, 120, 180, 0.16);
}

.key-entry-card .message {
    margin: 14px 0 0;
}

.user-entry-page .message {
    position: relative;
    align-items: center;
    justify-content: flex-start;
    min-height: 52px;
    padding: 13px 16px;
    margin: 14px 0 0;
    border: 1px solid rgba(164, 184, 228, 0.24);
    border-radius: 16px;
    background:
        radial-gradient(circle at 97% 0%, rgba(121, 92, 255, 0.12), transparent 32%),
        linear-gradient(112deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 246, 255, 0.95) 50%, rgba(239, 248, 255, 0.92) 100%);
    color: #253047;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.55;
    box-shadow: 0 14px 32px rgba(72, 83, 120, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

.user-entry-page .message::before {
    content: var(--message-symbol, "i");
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background:
        linear-gradient(135deg, var(--message-accent, #7b5cff), var(--message-accent-strong, #4e94f4));
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 20px var(--message-glow, rgba(123, 92, 255, 0.22));
}

.user-entry-page .message::after {
    content: none;
}

.user-entry-page .message.info {
    --message-symbol: "i";
    --message-accent: #8b5cf6;
    --message-accent-strong: #4e94f4;
    --message-glow: rgba(123, 92, 255, 0.2);
    background:
        radial-gradient(circle at 94% 12%, rgba(78, 148, 244, 0.13), transparent 28%),
        linear-gradient(112deg, rgba(252, 250, 255, 0.98) 0%, rgba(246, 242, 255, 0.95) 48%, rgba(240, 248, 255, 0.93) 100%);
    color: #28324a;
    border-color: rgba(139, 92, 246, 0.2);
}

.user-entry-page .message.success {
    --message-symbol: "OK";
    --message-accent: #22c55e;
    --message-accent-strong: #57d68d;
    --message-glow: rgba(34, 197, 94, 0.18);
    background:
        radial-gradient(circle at 94% 12%, rgba(34, 197, 94, 0.1), transparent 28%),
        linear-gradient(112deg, rgba(250, 255, 252, 0.98) 0%, rgba(241, 255, 247, 0.94) 52%, rgba(245, 250, 255, 0.92) 100%);
    color: #173f2a;
    border-color: rgba(34, 197, 94, 0.2);
}

.user-entry-page .message.success::before {
    font-size: 10px;
    letter-spacing: 0;
}

.user-entry-page .message.error {
    --message-symbol: "!";
    --message-accent: #ef4444;
    --message-accent-strong: #fb7185;
    --message-glow: rgba(239, 68, 68, 0.18);
    background:
        radial-gradient(circle at 94% 12%, rgba(239, 68, 68, 0.1), transparent 28%),
        linear-gradient(112deg, rgba(255, 251, 251, 0.98) 0%, rgba(255, 242, 244, 0.94) 52%, rgba(255, 247, 250, 0.92) 100%);
    color: #5d1e24;
    border-color: rgba(239, 68, 68, 0.2);
}

.user-entry-page .message.warning {
    --message-symbol: "!";
    --message-accent: #f59e0b;
    --message-accent-strong: #fbbf24;
    --message-glow: rgba(245, 158, 11, 0.18);
    background:
        radial-gradient(circle at 94% 12%, rgba(245, 158, 11, 0.12), transparent 28%),
        linear-gradient(112deg, rgba(255, 253, 247, 0.98) 0%, rgba(255, 248, 232, 0.94) 52%, rgba(255, 251, 244, 0.92) 100%);
    color: #5b3b08;
    border-color: rgba(245, 158, 11, 0.22);
}

html[data-theme="dark"] .user-entry-page .message {
    border-color: rgba(139, 148, 158, 0.24);
    background:
        radial-gradient(circle at 94% 12%, rgba(88, 166, 255, 0.12), transparent 28%),
        linear-gradient(112deg, rgba(22, 27, 34, 0.96) 0%, rgba(25, 28, 42, 0.94) 52%, rgba(18, 31, 47, 0.9) 100%);
    color: var(--text-primary-dark);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .user-entry-page .message.info {
    border-color: rgba(139, 92, 246, 0.28);
}

html[data-theme="dark"] .user-entry-page .message.success {
    border-color: rgba(34, 197, 94, 0.28);
}

html[data-theme="dark"] .user-entry-page .message.error {
    border-color: rgba(239, 68, 68, 0.3);
}

html[data-theme="dark"] .user-entry-page .message.warning {
    border-color: rgba(245, 158, 11, 0.3);
}

.key-entry-card #keyInfo {
    margin-top: 16px;
}

.key-entry-card.is-key-validated > h2,
.key-entry-card.is-key-validated .key-entry-subtitle,
.key-entry-card.is-key-validated .key-input-shell,
.key-entry-card.is-key-validated .weibo-login-button,
.key-entry-card.is-key-validated .key-entry-privacy {
    display: none;
}

.key-entry-card.is-key-validated #keyInfo {
    margin-top: 0;
}

.key-entry-card.is-key-validated.card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.user-entry-page .welcome-panel {
    display: none !important;
}

.user-key-info-card {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    margin: 0 auto 18px;
    padding: 25px 24px;
    min-height: 0;
    border: 1px solid rgba(164, 184, 228, 0.22);
    border-radius: 13px;
    background:
        radial-gradient(circle at 77% 29%, rgba(136, 111, 255, 0.18), transparent 16%),
        radial-gradient(circle at 94% 21%, rgba(100, 190, 255, 0.18), transparent 18%),
        linear-gradient(105deg, rgba(250, 246, 255, 0.96) 0%, rgba(246, 241, 255, 0.95) 36%, rgba(232, 247, 255, 0.92) 100%);
    box-shadow: 0 16px 34px rgba(72, 83, 120, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.user-key-info-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.user-key-info-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-key-info-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(145deg, #8a5cff, #4d7dff);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(93, 104, 255, 0.22);
}

.user-key-info-icon svg {
    width: 23px;
    height: 23px;
}

.user-key-info-title h3 {
    margin: 0;
    color: #161d2d;
    font-size: 22px;
    font-weight: 850;
    line-height: 1.2;
}

.user-key-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 23px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(39, 211, 125, 0.12);
    color: #16a765;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.user-key-status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(39, 211, 125, 0.12);
}

.user-key-info-card .key-info-item {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 27px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #202838;
    font-size: 14px;
    line-height: 1.45;
}

.user-key-info-card #keyNoteDisplay {
    width: 100%;
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: start;
    margin-top: 6px;
}

.user-key-info-card .key-note-item-note,
html[data-theme="dark"] .user-key-info-card .key-note-item-note {
    padding: 0;
    border: 0;
    background: transparent;
}

.user-key-info-card #keyNote {
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
}

.user-key-info-card .key-info-label {
    margin: 0;
    color: #4b5365;
    font-size: 14px;
    font-weight: 650;
}

.user-key-info-card .key-status,
.user-key-info-card .key-info-item > span:not(.key-info-label):not(.countdown-tag),
.user-key-info-card .key-info-item > strong:not(.key-info-label):not(.countdown-tag) {
    min-width: 0;
    color: #182033;
    font-size: 14px;
    font-weight: 650;
    word-break: break-word;
}

.user-key-status-badge.key-status.valid {
    display: inline-flex;
    width: fit-content;
    min-height: 26px;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(39, 211, 125, 0.13);
    color: #18a768;
    font-size: 14px;
    font-weight: 800;
}

.user-key-status-badge.key-status.expired,
.user-key-status-badge.key-status.invalid {
    display: inline-flex;
    width: fit-content;
    min-height: 26px;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(248, 81, 73, 0.1);
    color: #d9403a;
}

.user-key-status-badge.key-status.disabled {
    display: inline-flex;
    width: fit-content;
    min-height: 26px;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
}

.user-key-status-badge.key-status.expired::before,
.user-key-status-badge.key-status.invalid::before {
    box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.12);
}

.user-key-status-badge.key-status.disabled::before {
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.14);
}

html[data-theme="dark"] .user-key-status-badge.key-status.disabled {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
}

html[data-theme="dark"] .user-key-status-badge.key-status.disabled::before {
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.16);
}

.user-key-info-card .countdown-tag {
    display: none;
}

.user-key-info-art {
    position: absolute;
    top: 48px;
    right: 36px;
    width: 236px;
    height: 132px;
    pointer-events: none;
}

.user-key-shield {
    position: absolute;
    left: 56px;
    top: 11px;
    width: 72px;
    height: 82px;
    filter: drop-shadow(0 18px 24px rgba(82, 101, 255, 0.24));
}

.user-key-shield svg {
    width: 100%;
    height: 100%;
}

.user-key-platform {
    position: absolute;
    left: 22px;
    right: 8px;
    bottom: 9px;
    height: 31px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(221, 228, 255, 0.55));
    box-shadow: 0 12px 22px rgba(123, 136, 210, 0.13);
}

.user-key-mini-key {
    position: absolute;
    right: 24px;
    top: 44px;
    width: 34px;
    height: 49px;
}

.user-key-mini-key::before {
    content: "";
    position: absolute;
    top: 0;
    left: 4px;
    width: 20px;
    height: 20px;
    border: 7px solid #91bcff;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(84, 132, 220, 0.18);
}

.user-key-mini-key::after {
    content: "";
    position: absolute;
    left: 15px;
    top: 24px;
    width: 8px;
    height: 23px;
    border-radius: 999px;
    background: #82aafa;
}

.user-key-mini-key span {
    position: absolute;
    left: 20px;
    width: 12px;
    height: 5px;
    border-radius: 999px;
    background: #82aafa;
}

.user-key-mini-key span:first-child {
    top: 35px;
}

.user-key-mini-key span:last-child {
    top: 43px;
}

.user-key-dot {
    position: absolute;
    border-radius: 50%;
    background: rgba(147, 152, 255, 0.16);
}

.user-key-dot.dot-one {
    width: 14px;
    height: 14px;
    right: 52px;
    top: 4px;
}

.user-key-dot.dot-two {
    width: 8px;
    height: 8px;
    left: 32px;
    top: 64px;
}

html[data-theme="dark"] .user-key-info-card {
    border-color: rgba(139, 148, 158, 0.22);
    background: transparent;
    box-shadow: none;
}

html[data-theme="dark"] .user-key-info-card .key-info-item,
html[data-theme="dark"] .user-key-info-card .key-note-item-note {
    background: transparent;
    background-color: transparent;
    border-color: transparent;
}

html[data-theme="dark"] .user-key-info-title h3,
html[data-theme="dark"] .user-key-info-card .key-info-item > span:not(.key-info-label):not(.countdown-tag),
html[data-theme="dark"] .user-key-info-card .key-info-item > strong:not(.key-info-label):not(.countdown-tag) {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] .user-key-info-card .key-info-label {
    color: var(--text-secondary-dark);
}

@media (max-width: 768px) {
    .user-key-info-card {
        padding: 22px 20px;
        min-height: 0;
    }

    .user-key-info-card .key-info-item {
        grid-template-columns: 78px minmax(0, 1fr);
        width: 100%;
    }

    .user-key-info-card #keyNoteDisplay {
        grid-template-columns: 78px minmax(0, 1fr);
        width: 100%;
    }

    .user-key-info-art {
        right: 8px;
        transform: scale(0.78);
        transform-origin: right center;
    }

}

@media (max-width: 600px) {
    .key-entry-card.is-key-validated.card {
        width: 100%;
        max-width: none;
    }

    .user-key-info-card {
        width: 100%;
        max-width: none;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        padding-right: 20px;
    }

    .user-key-info-art {
        display: none;
    }

    .user-key-info-title {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .user-key-info-header {
        flex-direction: column;
        gap: 12px;
    }

    .user-key-status-badge {
        margin-top: 6px;
    }
}

@media (max-width: 480px) {
    .key-entry-card.is-key-validated.card {
        width: 100%;
        max-width: none;
    }

    .key-entry-card.card {
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    .user-key-info-card {
        width: 100%;
        max-width: none;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        padding: 20px 16px;
        border-radius: 12px;
    }

    .user-key-info-title h3 {
        font-size: 20px;
    }

    .user-key-info-card .key-info-item {
        grid-template-columns: 78px minmax(0, 1fr) !important;
        width: 100%;
        gap: 12px;
    }

    .user-key-info-card #keyNoteDisplay {
        grid-template-columns: 78px minmax(0, 1fr) !important;
        width: 100%;
    }
}

@media (max-width: 390px) {
    .key-entry-card.card {
        padding: 20px 16px;
    }

    .key-entry-card h2 {
        font-size: 22px;
        line-height: 1.25;
    }

    .key-entry-subtitle {
        font-size: 15px;
        line-height: 1.45;
    }

    .weibo-login-button {
        min-height: 56px;
        padding: 0 16px;
        font-size: 16px;
        gap: 8px;
    }

}

@media (max-width: 390px) {
    .user-key-info-card .key-info-item,
    .user-key-info-card #keyNoteDisplay {
        grid-template-columns: 78px minmax(0, 1fr) !important;
        gap: 12px;
    }

    .user-key-info-card .key-info-label {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .user-key-info-card .key-info-item {
        display: grid;
        flex-wrap: initial;
        row-gap: initial;
    }
}

.key-entry-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 18px 0 0;
    color: #7e8798;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.5;
    text-align: center;
}

.key-entry-privacy svg {
    width: 17px;
    height: 17px;
    color: #98a0b2;
    flex: 0 0 auto;
}

html[data-theme="dark"] body.user-entry-page {
    background:
        radial-gradient(circle at 79% 12%, rgba(88, 166, 255, 0.16), transparent 22%),
        radial-gradient(circle at 62% 34%, rgba(248, 81, 173, 0.11), transparent 18%),
        linear-gradient(111deg, #10151f 0%, #121827 48%, #0d1117 100%);
}

html[data-theme="dark"] .user-login-hero h1 {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] .user-login-hero .subtitle,
html[data-theme="dark"] .user-login-benefits,
html[data-theme="dark"] .key-entry-subtitle,
html[data-theme="dark"] .key-entry-privacy {
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] .key-entry-card.card {
    border: 1px solid rgba(139, 148, 158, 0.18);
    background: rgba(22, 27, 34, 0.82);
    box-shadow: 0 20px 52px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .key-entry-card.is-key-validated.card {
    border: 0;
    background: transparent;
    box-shadow: none;
}

html[data-theme="dark"] .key-entry-card h2,
html[data-theme="dark"] .key-input-shell input[type="text"] {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] .key-input-shell input[type="text"] {
    border-color: transparent;
    background: transparent;
    background-color: transparent;
    box-shadow: none;
}

html[data-theme="dark"] .key-input-shell input[type="text"]::placeholder {
    color: rgba(139, 148, 158, 0.76);
}

html[data-theme="dark"] .key-input-shell input[type="text"]:focus {
    border-color: transparent;
    background: transparent;
    background-color: transparent;
    box-shadow: none;
}

html[data-theme="dark"] .key-input-shell {
    border-color: rgba(139, 148, 158, 0.22);
    background: rgba(33, 38, 45, 0.72);
}

html[data-theme="dark"] .key-input-shell:focus-within {
    border-color: rgba(88, 166, 255, 0.55);
    background: rgba(33, 38, 45, 0.88);
}

.welcome-panel {
    --panel-accent-rgb: 40, 167, 69;
    --panel-alt-rgb: 0, 123, 255;
    --panel-status: var(--success-light);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 25px;
    padding: 22px 24px;
    border: 1px solid rgba(var(--panel-accent-rgb), 0.22);
    border-radius: 16px;
    background:
        linear-gradient(120deg, rgba(var(--panel-alt-rgb), 0.12), rgba(var(--panel-accent-rgb), 0.13), rgba(var(--panel-alt-rgb), 0.1), rgba(var(--panel-accent-rgb), 0.13)),
        var(--bg-secondary-light);
    background-size: 240% 240%, auto;
    box-shadow:
        0 22px 52px rgba(15, 23, 42, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
    animation: welcomeGradientFlow 8s ease-in-out infinite;
}

.welcome-panel.is-bound {
    border-color: rgba(40, 167, 69, 0.32);
    box-shadow:
        0 24px 58px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(40, 167, 69, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.welcome-panel.is-expired {
    --panel-accent-rgb: 217, 119, 6;
    --panel-alt-rgb: 245, 158, 11;
    --panel-status: #d97706;
    border-color: rgba(217, 119, 6, 0.34);
    box-shadow:
        0 24px 58px rgba(146, 64, 14, 0.12),
        0 0 0 1px rgba(217, 119, 6, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.welcome-panel.is-disabled {
    --panel-accent-rgb: 100, 116, 139;
    --panel-alt-rgb: 148, 163, 184;
    --panel-status: #64748b;
    border-color: rgba(100, 116, 139, 0.32);
    box-shadow:
        0 24px 58px rgba(51, 65, 85, 0.11),
        0 0 0 1px rgba(100, 116, 139, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.welcome-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.34) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.7), transparent 72%);
    pointer-events: none;
}

.welcome-panel::after {
    content: "";
    position: absolute;
    top: -28%;
    bottom: -28%;
    left: -45%;
    width: 38%;
    transform: skewX(-18deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
    animation: welcomeSheen 3.2s cubic-bezier(0.4, 0, 0.2, 1) 0.2s infinite;
    pointer-events: none;
}

.welcome-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
    padding-right: 124px;
}

.welcome-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    color: var(--panel-status);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.welcome-copy h2 {
    margin: 0;
    color: var(--text-primary-light);
    font-size: 1.5rem;
    line-height: 1.2;
}

.welcome-copy p {
    margin: 8px 0 0;
    color: var(--text-secondary-light);
    font-size: 0.95rem;
}

.welcome-status {
    position: absolute;
    top: 18px;
    right: 20px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(var(--panel-accent-rgb), 0.28);
    color: var(--panel-status);
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.welcome-status svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.welcome-panel .user-key-display {
    width: fit-content;
    max-width: 100%;
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(var(--panel-accent-rgb), 0.24);
    background: rgba(255, 255, 255, 0.58);
    color: var(--text-primary-light);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    box-shadow:
        0 12px 28px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.welcome-panel .user-key-display svg {
    width: 18px;
    height: 18px;
    padding: 3px;
    border-radius: 7px;
    color: var(--panel-status);
    background: rgba(var(--panel-accent-rgb), 0.1);
    flex-shrink: 0;
}

.welcome-panel .user-key-display span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0;
}

html[data-theme="dark"] .welcome-panel {
    --panel-accent-rgb: 63, 185, 80;
    --panel-alt-rgb: 88, 166, 255;
    --panel-status: var(--success-dark);
    border-color: rgba(88, 166, 255, 0.22);
    background:
        linear-gradient(120deg, rgba(var(--panel-alt-rgb), 0.14), rgba(var(--panel-accent-rgb), 0.11), rgba(var(--panel-alt-rgb), 0.1), rgba(var(--panel-accent-rgb), 0.12)),
        var(--bg-secondary-dark);
    background-size: 240% 240%, auto;
    box-shadow:
        0 22px 58px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .welcome-panel.is-bound {
    border-color: rgba(63, 185, 80, 0.3);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.36),
        0 0 0 1px rgba(63, 185, 80, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .welcome-panel.is-expired {
    --panel-accent-rgb: 240, 180, 41;
    --panel-alt-rgb: 217, 119, 6;
    --panel-status: #f0b429;
    border-color: rgba(240, 180, 41, 0.3);
}

html[data-theme="dark"] .welcome-panel.is-disabled {
    --panel-accent-rgb: 148, 163, 184;
    --panel-alt-rgb: 71, 85, 105;
    --panel-status: #94a3b8;
    border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .welcome-panel::before {
    background:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
}

html[data-theme="dark"] .welcome-panel::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

html[data-theme="dark"] .welcome-copy h2 {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] .welcome-copy p {
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] .welcome-status {
    background: rgba(13, 17, 23, 0.58);
    border-color: rgba(var(--panel-accent-rgb), 0.24);
}

html[data-theme="dark"] .welcome-panel .user-key-display {
    border-color: rgba(var(--panel-accent-rgb), 0.28);
    background: rgba(13, 17, 23, 0.5);
    color: var(--text-primary-dark);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .welcome-panel .user-key-display svg {
    background: rgba(var(--panel-accent-rgb), 0.12);
}

@keyframes welcomeSheen {
    0% {
        left: -45%;
        opacity: 0;
    }

    14%,
    52% {
        opacity: 1;
    }

    72%,
    100% {
        left: 125%;
        opacity: 0;
    }
}

@keyframes welcomeGradientFlow {
    0%,
    100% {
        background-position: 0% 50%, 0 0;
    }

    50% {
        background-position: 100% 50%, 0 0;
    }
}

#qrCodeImage {
    max-width: 100%;
    width: 280px;
    /* Slightly adjusted default size */
    height: auto;
    border: 1px solid var(--border-color-light);
    border-radius: var(--input-border-radius);
    margin: 15px auto;
    display: block;
}

#qrCodeContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

#keysTable {
    min-height: 300px;
}

#keysTableContainer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color-light);
    border-radius: var(--input-border-radius);
    overflow: hidden;
}

th,
td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color-light);
}

th {
    background-color: var(--bg-tertiary-light);
    font-weight: 600;
    color: var(--text-primary-light);
}

tr:last-child td {
    border-bottom: none;
}

td .actions button {
    margin-right: 10px; /* 增加间距 */
    padding: 5px 8px;
    font-size: 0.8rem;
}

td .actions button:last-child {
    margin-right: 0;
}

.status-active {
    color: var(--success-light);
    font-weight: 500;
}

.status-disabled {
    color: var(--disabled-text-light);
    font-style: italic;
}

.status-expired {
    color: var(--error-light);
    font-weight: 500;
}

.loader {
    width: 28px;
    height: 28px;
    border: 3px solid var(--bg-tertiary-light);
    border-top-color: var(--accent-primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
    display: none;
}

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

.expiry-preset-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.expiry-preset-row label {
    margin-bottom: 0;
    white-space: nowrap;
}

.expiry-preset-row select {
    flex-grow: 1;
    margin-bottom: 0;
}

.expiry-preset-row input[type="datetime-local"] {
    flex-grow: 1.5;
    margin-bottom: 0;
}

/* QR Actions Buttons Styling */
#qrActions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

#qrActions button {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* Fullscreen Modal Styles */
#fullscreenQrModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background-color: rgba(0, 0, 0, 0.9);
    /* Darker overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: calc(15px + env(safe-area-inset-top)) calc(15px + env(safe-area-inset-right)) calc(15px + env(safe-area-inset-bottom)) calc(15px + env(safe-area-inset-left));
    cursor: zoom-out;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

#fullscreenQrImage {
    max-width: 95vw;
    max-height: 95vh;
    /* Use viewport units for better fit */
    object-fit: contain;
    border-radius: var(--input-border-radius);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.15);
}

#closeFullscreenModalButton {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    line-height: 34px;
    text-align: center;
    padding: 0;
    cursor: pointer;
}

#closeFullscreenModalButton:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* Responsive Button Group */
.button-group-responsive {
    display: flex;
    gap: 10px;
}

.button-group-responsive button {
    flex-grow: 1; /* Make buttons share space equally */
}

@media (max-width: 768px) {
    .button-group-responsive {
        flex-direction: column;
    }

    .logs-entry-row {
        align-items: stretch;
    }

    body {
        padding: calc(10px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
    }

    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    header p.subtitle {
        font-size: 0.9rem;
    }

    .card {
        padding: 15px;
    }

    .key-info-item {
        flex-wrap: wrap;
        row-gap: 5px;
    }

    .logs-help-tooltip {
        right: -4px;
    }

    .countdown-tag {
        flex-basis: 100%;
        text-align: center;
        margin-left: 0;
    }

    input[type="text"],
    input[type="password"],
    input[type="datetime-local"],
    input[type="date"],
    input[type="number"],
    textarea,
    select,
    button {
        font-size: 16px;
        padding: 10px;
    }

    #qrCodeImage {
        width: 90%;
        max-width: 240px;
    }

    .theme-switch-button {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    #keysTableContainer {
        margin-right: -15px;
        padding-right: 15px;
    }

    #keysTable {
        display: table;
        width: max-content;
        min-width: 100%;
        overflow: visible;
    }

    #keysTable th:first-child,
    #keysTable td:first-child {
        position: sticky;
        left: 0;
        z-index: 3;
        padding-left: 10px;
        padding-right: 10px;
        background-color: var(--bg-secondary-light);
        box-shadow: 10px 0 18px -14px rgba(15, 23, 42, 0.45);
        transition: min-width var(--transition-fast), max-width var(--transition-fast);
    }

    #keysTableContainer.is-scrolled #keysTable th:first-child,
    #keysTableContainer.is-scrolled #keysTable td:first-child {
        width: 72px;
        min-width: 72px;
        max-width: 72px;
    }

    #keysTable th:first-child {
        z-index: 4;
        background-color: var(--bg-tertiary-light);
    }

    #keysTable .copyable-key {
        overflow: visible;
        text-decoration: none;
        text-overflow: clip;
        word-break: normal;
        white-space: nowrap;
    }

    #keysTable .copyable-key .key-cell-text::before {
        content: attr(data-short-key);
        display: none;
        max-width: 6ch;
        overflow: hidden;
        font-weight: 700;
        letter-spacing: 0.02em;
    }

    #keysTableContainer.is-scrolled #keysTable .copyable-key {
        color: transparent;
        font-size: 0;
        overflow: hidden;
        text-overflow: clip;
    }

    #keysTableContainer.is-scrolled #keysTable .copyable-key .key-cell-text::before {
        display: inline-block;
    }

    #keysTableContainer.is-scrolled #keysTable .copyable-key .key-cell-text::before {
        color: var(--accent-primary-light);
        font-size: 0.82rem;
    }

    #keysTableContainer.is-scrolled #keysTable .copyable-key .key-cell-content {
        gap: 5px;
    }

    #keysTable .key-note-cell {
        min-width: 132px;
        max-width: 160px;
        font-size: 0.78rem;
        line-height: 1.35;
        white-space: normal;
    }

    html[data-theme="dark"] #keysTable th:first-child,
    html[data-theme="dark"] #keysTable td:first-child {
        background-color: var(--bg-secondary-dark);
        box-shadow: 10px 0 18px -14px rgba(0, 0, 0, 0.85);
    }

    html[data-theme="dark"] #keysTable th:first-child {
        background-color: var(--bg-tertiary-dark);
    }

    html[data-theme="dark"] #keysTableContainer.is-scrolled #keysTable .copyable-key .key-cell-text::before {
        color: var(--accent-primary-dark);
    }

    th,
    td {
        white-space: nowrap;
    }

    .expiry-preset-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .expiry-preset-row label {
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.6rem;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group input,
    .input-group button {
        border-radius: var(--input-border-radius);
        border-right: 1px solid var(--border-color-light);
        margin-bottom: 8px;
    }

    html[data-theme="dark"] .input-group input {
        border-right-color: var(--border-color-dark);
    }

    .input-group button {
        margin-left: 0;
        width: 100%;
    }

    td .actions button {
        margin-bottom: 5px;
        display: block;
        width: 100%;
    }

    #qrActions {
        flex-direction: column;
        gap: 8px;
    }

    #qrActions button {
        width: 100%;
    }
}

.mt-1 {
    margin-top: .25rem
}

.mt-2 {
    margin-top: .5rem
}

.mt-3 {
    margin-top: 1rem
}

.mb-1 {
    margin-bottom: .25rem
}

.mb-2 {
    margin-bottom: .5rem
}

.mb-3 {
    margin-bottom: 1rem
}

.text-center {
    text-align: center
}

.d-none {
    display: none !important
}

.d-block {
    display: block !important
}

.w-100 {
    width: 100%
}

.auth-success-transition {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 42%, rgba(40, 167, 69, 0.22), transparent 34%),
        rgba(244, 246, 248, 0.72);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    opacity: 0;
    transition: opacity 0.32s ease;
}

.auth-success-transition.is-visible {
    opacity: 1;
}

.auth-success-transition.is-leaving {
    opacity: 0;
}

.auth-success-transition.is-expired {
    background:
        radial-gradient(circle at 50% 42%, rgba(217, 119, 6, 0.22), transparent 34%),
        rgba(244, 246, 248, 0.72);
}

.auth-success-card {
    width: min(420px, calc(100vw - 48px));
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 10px;
    padding: 24px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
    transform: translateY(14px) scale(0.97);
    transition: transform 0.48s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.auth-success-transition.is-visible .auth-success-card {
    transform: translateY(0) scale(1);
}

.auth-success-ring {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #28a745;
    background: linear-gradient(145deg, rgba(40, 167, 69, 0.14), rgba(0, 123, 255, 0.1));
}

.auth-success-transition.is-expired .auth-success-ring {
    color: #d97706;
    background: linear-gradient(145deg, rgba(217, 119, 6, 0.15), rgba(245, 158, 11, 0.1));
}

.auth-success-ring svg {
    width: 48px;
    height: 48px;
}

.auth-success-circle {
    stroke: currentColor;
    stroke-width: 3;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: authCircle 0.55s ease forwards 0.12s;
}

.auth-success-check {
    stroke: currentColor;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 34;
    stroke-dashoffset: 34;
    animation: authCheck 0.38s ease forwards 0.54s;
}

.auth-success-eyebrow {
    margin: 0 0 4px;
    color: var(--success-light);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
}

.auth-success-transition.is-expired .auth-success-eyebrow {
    color: #d97706;
}

.auth-success-card h2 {
    margin: 0 0 5px;
    color: var(--text-primary-light);
    font-size: 1.35rem;
    line-height: 1.25;
}

.auth-success-card p:last-child {
    margin: 0;
    color: var(--text-secondary-light);
    font-size: 0.95rem;
}

html[data-theme="dark"] .auth-success-transition {
    background:
        radial-gradient(circle at 50% 42%, rgba(63, 185, 80, 0.2), transparent 34%),
        rgba(13, 17, 23, 0.72);
}

html[data-theme="dark"] .auth-success-transition.is-expired {
    background:
        radial-gradient(circle at 50% 42%, rgba(210, 153, 34, 0.22), transparent 34%),
        rgba(13, 17, 23, 0.72);
}

html[data-theme="dark"] .auth-success-card {
    border-color: rgba(139, 148, 158, 0.28);
    background: rgba(22, 27, 34, 0.88);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

html[data-theme="dark"] .auth-success-ring {
    color: var(--success-dark);
    background: linear-gradient(145deg, rgba(63, 185, 80, 0.14), rgba(88, 166, 255, 0.1));
}

html[data-theme="dark"] .auth-success-transition.is-expired .auth-success-ring {
    color: var(--warning-dark);
    background: linear-gradient(145deg, rgba(210, 153, 34, 0.14), rgba(88, 166, 255, 0.1));
}

html[data-theme="dark"] .auth-success-eyebrow {
    color: var(--success-dark);
}

html[data-theme="dark"] .auth-success-transition.is-expired .auth-success-eyebrow {
    color: var(--warning-dark);
}

html[data-theme="dark"] .auth-success-card h2 {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] .auth-success-card p:last-child {
    color: var(--text-secondary-dark);
}

@keyframes authCircle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes authCheck {
    to {
        stroke-dashoffset: 0;
    }
}

/* Pagination Controls Styling */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping */
    gap: 15px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color-light);
    margin-top: 20px;
}

html[data-theme="dark"] .pagination-controls {
    border-top-color: var(--border-color-dark);
}

.pagination-controls button {
    padding: 8px 15px;
    font-size: 0.9rem;
    min-width: 80px;
}

.pagination-controls .page-info {
    font-size: 0.95rem;
    color: var(--text-secondary-light);
    white-space: nowrap;
}

.pagination-go-to {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-go-to .page-input {
    width: 60px; /* Adjust width as needed */
    padding: 6px 8px;
    margin-bottom: 0; /* Override default margin-bottom */
    text-align: center;
    font-size: 0.9rem;
}

.pagination-go-to button {
    padding: 6px 10px;
    font-size: 0.9rem;
}

html[data-theme="dark"] .pagination-controls .page-info {
    color: var(--text-secondary-dark);
}

/* Adjust button styles for pagination if needed, ensuring consistency */
.pagination-controls button:disabled {
    background-color: var(--disabled-bg-light);
    color: var(--disabled-text-light);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}

    html[data-theme="dark"] .pagination-controls button:disabled {
        background-color: var(--disabled-bg-dark);
        color: var(--disabled-text-dark);
    }

/* Quick Fill Tags Styling */
.quick-fill-tags-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color-light);
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative; /* For fade effect */
}

html[data-theme="dark"] .quick-fill-tags-container {
    border-top-color: var(--border-color-dark);
}

.tag-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.tag-section-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary-light);
    margin-right: 5px;
    white-space: nowrap;
}

html[data-theme="dark"] .tag-section-title {
    color: var(--text-secondary-dark);
}

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

.tag-button {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: var(--button-border-radius);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    user-select: none;
    white-space: nowrap;
}

/* Category Tags - Blue/Accent */
.category-tags .tag-button {
    background-color: rgba(0, 123, 255, 0.1); /* Light blue background */
    color: var(--accent-primary-light);
    border-color: rgba(0, 123, 255, 0.3);
}

.category-tags .tag-button:hover {
    background-color: rgba(0, 123, 255, 0.2);
    border-color: var(--accent-primary-light);
}

html[data-theme="dark"] .category-tags .tag-button {
    background-color: rgba(88, 166, 255, 0.1);
    color: var(--accent-primary-dark);
    border-color: rgba(88, 166, 255, 0.3);
}

html[data-theme="dark"] .category-tags .tag-button:hover {
    background-color: rgba(88, 166, 255, 0.2);
    border-color: var(--accent-primary-dark);
}

/* Quantity Tags - Green/Success */
.quantity-tags .tag-button {
    background-color: rgba(40, 167, 69, 0.1); /* Light green background */
    color: var(--success-light);
    border-color: rgba(40, 167, 69, 0.3);
}

.quantity-tags .tag-button:hover {
    background-color: rgba(40, 167, 69, 0.2);
    border-color: var(--success-light);
}

html[data-theme="dark"] .quantity-tags .tag-button {
    background-color: rgba(63, 185, 80, 0.1);
    color: var(--success-dark);
    border-color: rgba(63, 185, 80, 0.3);
}

html[data-theme="dark"] .quantity-tags .tag-button:hover {
    background-color: rgba(63, 185, 80, 0.2);
    border-color: var(--success-dark);
}

/* Filter Tags - Orange/Warning */
.filter-tags .tag-button {
    background-color: rgba(255, 193, 7, 0.1); /* Light orange background */
    color: var(--warning-light);
    border-color: rgba(255, 193, 7, 0.3);
}

.filter-tags .tag-button:hover {
    background-color: rgba(255, 193, 7, 0.2);
    border-color: var(--warning-light);
}

html[data-theme="dark"] .filter-tags .tag-button {
    background-color: rgba(210, 153, 34, 0.1);
    color: var(--warning-dark);
    border-color: rgba(210, 153, 34, 0.3);
}

html[data-theme="dark"] .filter-tags .tag-button:hover {
    background-color: rgba(210, 153, 34, 0.2);
    border-color: var(--warning-dark);
}


/* QR Instruction Card Styling */
.qr-instruction-card {
    width: 100%;
    box-sizing: border-box;
    min-height: 82px;
    padding: 17px 20px;
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 16px;
    background:
        radial-gradient(circle at 86% 22%, rgba(78, 148, 244, 0.12), transparent 30%),
        radial-gradient(circle at 4% 50%, rgba(139, 92, 246, 0.1), transparent 24%),
        linear-gradient(112deg, rgba(252, 250, 255, 0.98) 0%, rgba(246, 242, 255, 0.95) 46%, rgba(240, 248, 255, 0.93) 100%);
    box-shadow: 0 16px 36px rgba(72, 83, 120, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

html[data-theme="dark"] .qr-instruction-card {
    border-color: rgba(139, 148, 158, 0.24);
    background:
        radial-gradient(circle at 86% 22%, rgba(88, 166, 255, 0.12), transparent 30%),
        radial-gradient(circle at 4% 50%, rgba(139, 92, 246, 0.14), transparent 24%),
        linear-gradient(112deg, rgba(22, 27, 34, 0.96) 0%, rgba(25, 28, 42, 0.94) 52%, rgba(18, 31, 47, 0.9) 100%);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.qr-instruction-icon-container {
    width: 52px;
    height: 52px;
    min-width: 52px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(139, 92, 246, 0.14), rgba(78, 148, 244, 0.12));
    color: #7b5cff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="dark"] .qr-instruction-icon-container {
    background:
        linear-gradient(145deg, rgba(139, 92, 246, 0.22), rgba(88, 166, 255, 0.14));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.qr-instruction-icon {
    width: 25px;
    height: 25px;
    color: currentColor;
}

html[data-theme="dark"] .qr-instruction-icon {
    color: #a78bfa;
}

.qr-instruction-text-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    flex-grow: 1;
    min-width: 0;
}

.qr-instruction-text,
.qr-instruction-sub-text {
    margin: 0;
    cursor: default;
    line-height: 1.4;
}

.qr-instruction-text {
    color: #1b2437;
    font-size: 16px;
    font-weight: 850;
    letter-spacing: 0;
}

html[data-theme="dark"] .qr-instruction-text {
    color: var(--text-primary-dark);
}

.qr-instruction-sub-text {
    margin-top: 5px;
    color: #7b8498;
    font-size: 13px;
    font-weight: 700;
}

html[data-theme="dark"] .qr-instruction-sub-text {
    color: var(--text-secondary-dark);
}

@media (max-width: 480px) {
    .user-entry-page .message {
        min-height: 50px;
        padding: 12px 13px;
        border-radius: 14px;
        font-size: 13px;
        line-height: 1.5;
    }

    .user-entry-page .message::before {
        width: 26px;
        height: 26px;
        border-radius: 9px;
        font-size: 14px;
    }

    .qr-instruction-card {
        align-items: flex-start;
        gap: 12px;
        min-height: 0;
        padding: 15px 14px;
        border-radius: 14px;
    }

    .qr-instruction-icon-container {
        width: 44px;
        height: 44px;
        min-width: 44px;
        border-radius: 14px;
    }

    .qr-instruction-icon {
        width: 22px;
        height: 22px;
    }

    .qr-instruction-text {
        font-size: 15px;
        line-height: 1.35;
    }

    .qr-instruction-sub-text {
        font-size: 12px;
        line-height: 1.45;
    }
}

/* QR login workspace */
#qrLoginModule.card {
    overflow: hidden;
    border: 1px solid rgba(164, 184, 228, 0.22);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 45px rgba(70, 84, 126, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#qrLoginModule > h2 {
    margin-bottom: 18px;
    color: #151b2d;
    font-size: 22px;
    font-weight: 850;
    line-height: 1.25;
}

#qrLoginModule #getQrCodeButton {
    min-height: 50px;
    border-radius: 999px;
    background: linear-gradient(98deg, #7b5cff 0%, #6d67f5 50%, #4e94f4 100%);
    box-shadow: 0 14px 28px rgba(92, 103, 245, 0.24);
}

#qrLoginModule #getQrCodeButton:hover {
    background: linear-gradient(98deg, #704fff 0%, #625cf0 50%, #4388ec 100%);
}

#qrLoginModule.has-qr-preview .qr-instruction-card,
#qrLoginModule.has-qr-preview #getQrCodeButton {
    display: none;
}

#qrLoginModule #loginStatusPolling {
    display: none !important;
}

.qr-preview-stage {
    margin: 2px 0 18px;
}

.qr-preview-wrapper {
    position: relative;
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr) 186px;
    align-items: center;
    gap: 22px;
    min-height: 188px;
    padding: 22px 26px;
    overflow: hidden;
    border: 1px solid rgba(203, 211, 235, 0.55);
    border-radius: 16px;
    background:
        radial-gradient(circle at 79% 78%, rgba(139, 92, 246, 0.16), transparent 23%),
        linear-gradient(111deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 62%, rgba(248, 246, 255, 0.96) 100%);
    box-shadow: 0 20px 46px rgba(86, 96, 148, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.qr-preview-wrapper::after {
    content: none;
}

.qr-preview-mobile-header,
.qr-preview-mobile-intro {
    display: none;
}

.qr-preview-code-column {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.qr-preview-code-frame {
    position: relative;
    width: 146px;
    height: 146px;
    padding: 18px;
    overflow: visible;
    border-radius: 0;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(103, 76, 220, 0.13);
}

.qr-preview-code-frame::before,
.qr-preview-code-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    pointer-events: none;
}

.qr-preview-code-frame::before {
    background:
        linear-gradient(#b899ff, #b899ff) left top / 28px 3px no-repeat,
        linear-gradient(#b899ff, #b899ff) left top / 3px 28px no-repeat,
        linear-gradient(#b899ff, #b899ff) right bottom / 28px 3px no-repeat,
        linear-gradient(#b899ff, #b899ff) right bottom / 3px 28px no-repeat;
}

.qr-preview-code-frame::after {
    background:
        linear-gradient(#b899ff, #b899ff) right top / 28px 3px no-repeat,
        linear-gradient(#b899ff, #b899ff) right top / 3px 28px no-repeat,
        linear-gradient(#b899ff, #b899ff) left bottom / 28px 3px no-repeat,
        linear-gradient(#b899ff, #b899ff) left bottom / 3px 28px no-repeat;
}

.qr-preview-image {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    object-fit: contain;
    background: #ffffff;
}

.fullscreen-button {
    min-height: 28px;
    padding: 0 12px;
    border: 1px solid rgba(124, 92, 255, 0.18);
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.09);
    color: #7a5cff;
    font-size: 12px;
    font-weight: 750;
    box-shadow: none;
}

.fullscreen-button:hover {
    background: rgba(124, 92, 255, 0.14);
    color: #6847ef;
    transform: translateY(-1px);
    box-shadow: none;
}

.qr-preview-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.qr-preview-steps {
    display: grid;
    gap: 12px;
}

.qr-preview-step {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
}

.qr-preview-step-index {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(124, 58, 237, 0.22);
}

.qr-preview-step-text {
    min-width: 0;
}

.qr-preview-step-text strong,
.qr-preview-step-text span {
    display: block;
}

.qr-preview-step-text strong {
    color: #151b2d;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.3;
}

.qr-preview-step-text span {
    margin-top: 2px;
    color: #70798f;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
}

.qr-preview-phone {
    position: relative;
    z-index: 1;
    width: clamp(154px, 17vw, 186px);
    aspect-ratio: 1;
    height: auto;
    justify-self: end;
    transform: translate(2px, 0);
}

.qr-preview-phone-illustration {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.timeline-container {
    --timeline-active: #7b5cff;
    --timeline-active-soft: rgba(123, 92, 255, 0.14);
    --timeline-success: #22c55e;
    --timeline-success-soft: rgba(34, 197, 94, 0.13);
    --timeline-error: #ef4444;
    --timeline-error-soft: rgba(239, 68, 68, 0.13);
    --timeline-warning: #f59e0b;
    --timeline-warning-soft: rgba(245, 158, 11, 0.16);
    --timeline-idle: #dce2ef;
    --timeline-text: #141a2c;
    --timeline-muted: #8a93a8;
    position: relative;
    margin: 16px 0 0;
    padding: 19px 22px 17px;
    overflow: hidden;
    border: 1px solid rgba(210, 218, 239, 0.58);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 18px 42px rgba(70, 84, 126, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.86);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.timeline-container.visible {
    opacity: 1;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.timeline-title {
    color: var(--timeline-text);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.25;
    white-space: nowrap;
}

.timeline-title-mobile {
    display: none;
}

.timeline-summary {
    min-width: 0;
    color: #6e7890;
    font-size: 13px;
    font-weight: 650;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-top: 22px;
    padding: 0 4px 8px;
}

.timeline-track::before,
.timeline-track::after {
    content: "";
    position: absolute;
    left: calc(12.5% + 4px);
    right: calc(12.5% + 4px);
    top: 12px;
    height: 5px;
    border-radius: 999px;
}

.timeline-track::before {
    background: #edf0f8;
}

.timeline-track::after {
    right: auto;
    width: var(--timeline-track-progress, 0%);
    background: linear-gradient(90deg, #775cff 0%, #9c86ff 100%);
    box-shadow: 0 6px 14px rgba(123, 92, 255, 0.2);
    transition: width 0.32s ease;
}

.timeline-item {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: 30px auto auto;
    justify-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
}

.timeline-icon {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    min-width: 28px;
    margin: 0;
    border: 4px solid #ffffff;
    border-radius: 50%;
    background: var(--timeline-idle);
    color: transparent;
    font-size: 0;
    font-weight: 900;
    box-shadow: 0 3px 10px rgba(111, 120, 145, 0.12);
    overflow: hidden;
}

.timeline-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    transform: translate(-50%, -50%);
}

.timeline-icon::before {
    content: none;
}

.timeline-content {
    min-width: 0;
    padding: 0 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: center;
}

.timeline-step-title,
.timeline-step-detail {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-step-title {
    color: #7d879c;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.35;
    white-space: nowrap;
}

.timeline-step-detail {
    margin-top: 2px;
    color: var(--timeline-muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.timeline-step-state {
    min-height: 20px;
    color: var(--timeline-muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 20px;
}

.timeline-item.is-active .timeline-icon {
    background: #ffffff;
    box-shadow: 0 0 0 6px rgba(123, 92, 255, 0.12), 0 8px 18px rgba(123, 92, 255, 0.24);
}

.timeline-item.is-active .timeline-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(123, 92, 255, 0.22);
    border-top-color: var(--timeline-active);
    border-radius: 50%;
    animation: timelineIconSpin 0.75s linear infinite;
}

.timeline-item.is-active .timeline-icon::after {
    content: none;
}

.timeline-item.is-active .timeline-step-title,
.timeline-item.is-active .timeline-step-state {
    color: var(--timeline-active);
}

.timeline-item.is-success .timeline-icon {
    background: var(--timeline-success);
    box-shadow: 0 0 0 5px var(--timeline-success-soft), 0 8px 18px rgba(34, 197, 94, 0.18);
}

.timeline-item.is-success .timeline-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 5px;
    border: 2px solid #ffffff;
    border-top: 0;
    border-right: 0;
    border-radius: 0;
    background: transparent;
    transform: translate(-50%, -60%) rotate(-45deg);
}

.timeline-item.is-success .timeline-step-title,
.timeline-item.is-success .timeline-step-state {
    color: var(--timeline-success);
}

.timeline-item.is-error .timeline-icon {
    background: var(--timeline-error);
    box-shadow: 0 0 0 6px var(--timeline-error-soft), 0 8px 18px rgba(239, 68, 68, 0.2);
}

.timeline-item.is-error .timeline-icon::after,
.timeline-item.is-warning .timeline-icon::after {
    content: "!";
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    font-size: 14px;
    font-weight: 950;
    line-height: 1;
    transform: translate(-50%, -52%);
}

.timeline-item.is-error .timeline-step-title,
.timeline-item.is-error .timeline-step-state {
    color: var(--timeline-error);
}

.timeline-item.is-warning .timeline-icon {
    background: var(--timeline-warning);
    box-shadow: 0 0 0 6px var(--timeline-warning-soft), 0 8px 18px rgba(245, 158, 11, 0.18);
}

.timeline-item.is-warning .timeline-step-title,
.timeline-item.is-warning .timeline-step-state {
    color: #d97706;
}

.timeline-footer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px 16px;
    align-items: center;
    margin-top: 12px;
}

.timeline-progress-line {
    grid-column: 1 / -1;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf0f8;
}

.timeline-progress-fill {
    display: block;
    width: var(--timeline-progress, 0);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #775cff 0%, #9c86ff 100%);
    box-shadow: 0 5px 12px rgba(123, 92, 255, 0.2);
    transition: width 0.32s ease;
}

.timeline-progress-text,
.timeline-footer-status {
    min-width: 0;
    color: #687287;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.timeline-footer-status {
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-container[data-progress-state="error"] .timeline-progress-fill,
.timeline-container[data-progress-state="error"] .timeline-track::after {
    background: linear-gradient(90deg, #ef4444, #fb7185);
}

.timeline-container[data-progress-state="warning"] .timeline-progress-fill,
.timeline-container[data-progress-state="warning"] .timeline-track::after {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.timeline-container[data-progress-state="success"] .timeline-progress-fill,
.timeline-container[data-progress-state="success"] .timeline-track::after {
    background: linear-gradient(90deg, #22c55e, #86efac);
}

html[data-theme="dark"] #qrLoginModule.card,
html[data-theme="dark"] .qr-preview-wrapper,
html[data-theme="dark"] .timeline-container {
    border-color: rgba(139, 148, 158, 0.24);
    background: rgba(22, 27, 34, 0.92);
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] #qrLoginModule > h2,
html[data-theme="dark"] .qr-preview-step-text strong,
html[data-theme="dark"] .qr-preview-mobile-header h3,
html[data-theme="dark"] .timeline-title {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] .qr-preview-step-text span,
html[data-theme="dark"] .qr-preview-mobile-intro,
html[data-theme="dark"] .timeline-summary,
html[data-theme="dark"] .timeline-step-detail,
html[data-theme="dark"] .timeline-progress-text,
html[data-theme="dark"] .timeline-footer-status {
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] .qr-preview-code-frame,
html[data-theme="dark"] .qr-preview-image {
    background-color: #ffffff;
}

html[data-theme="dark"] .timeline-track::before,
html[data-theme="dark"] .timeline-progress-line {
    background: rgba(139, 148, 158, 0.22);
}

html[data-theme="dark"] .timeline-icon {
    border-color: rgba(22, 27, 34, 0.96);
}

html[data-theme="dark"] .timeline-item.is-active .timeline-icon {
    background: rgba(13, 17, 23, 0.92);
}

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

@media (max-width: 768px) {
    #qrLoginModule.card {
        padding: 19px 18px 18px;
        border-radius: 18px;
    }

    #qrLoginModule > h2 {
        margin-bottom: 15px;
        font-size: 18px;
    }

    .qr-preview-stage {
        margin: 0 0 16px;
    }

    .qr-preview-wrapper {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
        max-width: none;
        min-height: 0;
        margin: 0 auto;
        padding: 18px 18px 20px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.96);
    }

    .qr-preview-wrapper::after,
    .qr-preview-phone {
        display: none;
    }

    .qr-preview-mobile-header {
        order: 1;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .qr-preview-mobile-header h3 {
        margin: 0;
        color: #151b2d;
        font-size: 16px;
        font-weight: 900;
        line-height: 1.2;
    }

    .qr-preview-mobile-intro {
        order: 2;
        display: block;
        margin: -2px 0 0;
        color: #8a93a8;
        font-size: 12px;
        font-weight: 650;
        line-height: 1.45;
        text-align: center;
        white-space: pre-line;
    }

    .qr-preview-copy {
        order: 4;
    }

    .qr-preview-steps {
        gap: 10px;
        width: min(176px, 72vw);
        max-width: none;
        margin: 2px auto 0;
    }

    .qr-preview-step {
        grid-template-columns: 22px minmax(0, 1fr);
        gap: 8px;
    }

    .qr-preview-step-index {
        width: 19px;
        height: 19px;
        font-size: 11px;
    }

    .qr-preview-step-text strong {
        font-size: 12px;
    }

    .qr-preview-step-text span {
        font-size: 11px;
    }

    .qr-preview-code-column {
        order: 3;
        gap: 8px;
    }

    .qr-preview-code-frame {
        width: min(176px, 72vw);
        height: min(176px, 72vw);
        padding: 18px;
        border-radius: 0;
    }

    .fullscreen-button {
        display: none;
    }

    .timeline-container {
        margin-top: 13px;
        padding: 18px 17px 17px;
        border-radius: 18px;
    }

    .timeline-header {
        margin-bottom: 20px;
    }

    .timeline-title {
        position: relative;
        padding-left: 10px;
        font-size: 16px;
    }

    .timeline-title-desktop {
        display: none;
    }

    .timeline-title-mobile {
        display: inline;
    }

    .timeline-title::before {
        content: "";
        position: absolute;
        left: 0;
        top: 3px;
        bottom: 3px;
        width: 3px;
        border-radius: 999px;
        background: var(--timeline-active);
    }

    .timeline-summary {
        max-width: 44%;
        font-size: 12px;
    }

    .timeline-track {
        display: grid;
        grid-template-columns: 1fr;
        gap: 18px;
        margin: 0;
        padding: 0;
    }

    .timeline-track::before,
    .timeline-track::after {
        left: 14px;
        right: auto;
        top: 15px;
        width: 3px;
        height: calc(100% - 30px);
        border-radius: 999px;
    }

    .timeline-track::after {
        width: 3px;
        height: var(--timeline-progress, 0%);
        max-height: calc(100% - 30px);
    }

    .timeline-item {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr) auto;
        grid-template-rows: auto;
        justify-items: stretch;
        align-items: center;
        gap: 14px;
        min-height: 50px;
    }

    .timeline-icon {
        width: 30px;
        height: 30px;
        min-width: 30px;
        border: 4px solid #ffffff;
        color: transparent;
        font-size: 0;
        box-shadow: 0 8px 18px rgba(111, 120, 145, 0.12);
    }

    .timeline-content {
        padding: 0;
        text-align: left;
    }

    .timeline-step-title {
        color: #151b2d;
        font-size: 14px;
        font-weight: 900;
        white-space: normal;
    }

    .timeline-step-detail {
        margin-top: 3px;
        font-size: 12px;
        line-height: 1.3;
    }

    .timeline-step-state {
        justify-self: end;
        padding-left: 8px;
        color: #8a93a8;
        font-size: 12px;
        white-space: nowrap;
    }

    .timeline-item.is-active .timeline-icon,
    .timeline-item.is-success .timeline-icon {
        background: #ffffff;
    }

    .timeline-item.is-success .timeline-icon {
        background: var(--timeline-success);
    }

    .timeline-item.is-success .timeline-step-state {
        color: var(--timeline-success);
    }

    .timeline-item.is-error .timeline-icon {
        background: linear-gradient(135deg, #ef4444, #fb7185);
    }

    .timeline-item.is-warning .timeline-icon {
        background: linear-gradient(135deg, #f59e0b, #fbbf24);
    }

    .timeline-footer {
        display: none;
    }

    html[data-theme="dark"] .timeline-step-title {
        color: var(--text-primary-dark);
    }
}

@media (max-width: 420px) {
    .timeline-container {
        padding: 17px 15px 16px;
    }

    .timeline-summary {
        max-width: 40%;
    }

    .timeline-item {
        grid-template-columns: 28px minmax(0, 1fr) auto;
        gap: 12px;
    }

    .timeline-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- New Styles for Qinglong ID Selector Modal --- */
.qinglong-id-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 60vh; /* Limit height and allow scrolling */
    overflow-y: auto;
    padding-right: 5px; /* Space for scrollbar */
}

.qinglong-id-item {
    background-color: var(--bg-secondary-light);
    border: 1px solid var(--border-color-light);
    border-radius: var(--input-border-radius);
    margin-bottom: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.3s ease-out forwards;
}

.qinglong-id-item:last-child {
    margin-bottom: 0;
}

.qinglong-id-item:hover {
    border-color: var(--accent-primary-light);
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--card-shadow-light);
}

.qinglong-task-item {
    background-color: var(--bg-secondary-light);
    border: 1px solid var(--border-color-light);
    border-radius: var(--input-border-radius);
    margin-bottom: 12px;
    padding: 15px;
    cursor: default;
    transition: all var(--transition-fast);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.3s ease-out forwards;
}

.qinglong-task-item:last-child {
    margin-bottom: 0;
}

.qinglong-task-header {
    gap: 12px;
}

.qinglong-task-id {
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--text-muted-light);
    font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
}

.qinglong-task-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.qinglong-task-status.enabled {
    color: var(--success-light);
    background-color: rgba(22, 163, 74, 0.12);
}

.qinglong-task-status.disabled {
    color: var(--warning-light);
    background-color: rgba(217, 119, 6, 0.12);
}

.qinglong-task-status.missing {
    color: var(--error-light);
    background-color: rgba(220, 38, 38, 0.12);
}

.qinglong-task-detail-row {
    align-items: stretch;
}

.qinglong-task-pre-value {
    display: block;
    max-width: 100%;
    max-height: 140px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

.qinglong-task-detail-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color-light);
}

.qinglong-task-detail-section h4 {
    margin: 0 0 10px;
    color: var(--text-secondary-light);
    font-size: 0.95rem;
}

.qinglong-task-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.id-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color-light);
}

.action-name {
    font-weight: 600;
    color: var(--accent-primary-light);
    font-size: 1.05rem;
}

.timestamp {
    font-size: 0.8rem;
    color: var(--text-muted-light);
}

.id-item-body .detail-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.detail-label {
    font-weight: 500;
    color: var(--text-secondary-light);
    margin-right: 8px;
    white-space: nowrap;
}

.detail-value {
    font-family: monospace;
    background-color: var(--bg-tertiary-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.filter-details-box {
    margin-top: 8px;
}

/* JSON Viewer Styles */
.json-viewer {
    background-color: var(--bg-tertiary-light);
    border: 1px solid var(--border-color-light);
    border-radius: var(--input-border-radius);
    padding: 12px;
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
}

.json-pair {
    display: flex;
    margin-bottom: 6px;
}

.json-pair.json-pair-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.json-pair:last-child {
    margin-bottom: 0;
}

.json-key {
    font-weight: 600;
    color: var(--text-secondary-light);
    margin-right: 8px;
    white-space: nowrap;
}

.json-value {
    color: var(--text-primary-light);
    word-break: break-all;
}

.json-nested-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: 12px;
    padding-left: 10px;
    border-left: 2px solid var(--border-color-light);
}

.json-array-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.json-array-index {
    flex: 0 0 auto;
    color: var(--text-muted-light);
    font-weight: 600;
}

.json-array-content {
    min-width: 0;
    flex: 1;
}

/* Dark Theme for Qinglong ID Selector */
html[data-theme="dark"] .qinglong-id-item {
    background-color: var(--bg-secondary-dark);
    border-color: var(--border-color-dark);
}

html[data-theme="dark"] .qinglong-task-item {
    background-color: var(--bg-secondary-dark);
    border-color: var(--border-color-dark);
}

html[data-theme="dark"] .qinglong-id-item:hover {
    border-color: var(--accent-primary-dark);
    box-shadow: var(--card-shadow-dark);
}

html[data-theme="dark"] .id-item-header {
    border-bottom-color: var(--border-color-dark);
}

html[data-theme="dark"] .qinglong-task-detail-section {
    border-top-color: var(--border-color-dark);
}

html[data-theme="dark"] .action-name {
    color: var(--accent-primary-dark);
}

html[data-theme="dark"] .timestamp {
    color: var(--text-muted-dark);
}

html[data-theme="dark"] .qinglong-task-id {
    color: var(--text-muted-dark);
}

html[data-theme="dark"] .qinglong-task-status.enabled {
    color: var(--success-dark);
}

html[data-theme="dark"] .qinglong-task-status.disabled {
    color: var(--warning-dark);
}

html[data-theme="dark"] .qinglong-task-status.missing {
    color: var(--error-dark);
}

html[data-theme="dark"] .detail-label {
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] .detail-value {
    background-color: var(--bg-primary-dark); /* Darker than the item bg */
}

html[data-theme="dark"] .qinglong-task-detail-section h4 {
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] .json-viewer {
    background-color: var(--bg-primary-dark);
    border-color: var(--border-color-dark);
}

html[data-theme="dark"] .json-key {
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] .json-value {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] .json-nested-list {
    border-left-color: var(--border-color-dark);
}

html[data-theme="dark"] .json-array-index {
    color: var(--text-muted-dark);
}


@keyframes rotate4 {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash4 {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }

  50% {
    stroke-dasharray: 90, 200;
    stroke-dashoffset: -35px;
  }

  100% {
    stroke-dashoffset: -125px;
  }
}

/* --- New Styles for Notification Settings --- */

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--card-border-radius);
    transition: opacity 0.2s ease-in-out;
}

html[data-theme="dark"] .loading-overlay {
    background-color: rgba(22, 27, 34, 0.7); /* --bg-secondary-dark with opacity */
}

/* Generic Spinner Style */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary-light);
    border-top-color: var(--accent-primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

html[data-theme="dark"] .spinner {
    border-color: var(--bg-tertiary-dark);
    border-top-color: var(--accent-primary-dark);
}

/* Switch Toggle Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 50px; /* Adjusted width */
    height: 28px; /* Adjusted height */
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary-light);
    transition: var(--transition-smooth);
    border-radius: 28px; /* Fully rounded */
    border: 1px solid var(--border-color-light);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px; /* Adjusted size */
    width: 20px; /* Adjusted size */
    left: 3px; /* Adjusted position */
    bottom: 3px; /* Adjusted position */
    background-color: white;
    transition: var(--transition-smooth);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

input:checked + .slider {
    background-color: var(--success-light);
    border-color: var(--success-light);
}

input:checked + .slider:before {
    transform: translateX(22px); /* Adjusted translation */
}

/* Dark theme for switch */
html[data-theme="dark"] .slider {
    background-color: var(--bg-tertiary-dark);
    border-color: var(--border-color-dark);
}

html[data-theme="dark"] .slider:before {
    background-color: var(--text-secondary-dark);
}

html[data-theme="dark"] input:checked + .slider {
    background-color: var(--success-dark);
    border-color: var(--success-dark);
}

html[data-theme="dark"] input:checked + .slider:before {
    background-color: var(--bg-secondary-dark);
}

/* --- Styles for Step 2: Configuration Module --- */

#configModule h2 {
    border-bottom: 1px solid var(--border-color-light);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

html[data-theme="dark"] #configModule h2 {
    border-bottom-color: var(--border-color-dark);
}

.config-sub-card {
    background-color: var(--bg-tertiary-light);
    border: 1px solid var(--border-color-light);
    border-radius: var(--input-border-radius);
    padding: 20px;
    margin-bottom: 20px;
    transition: all var(--transition-smooth);
    position: relative;
}

html[data-theme="dark"] .config-sub-card {
    background-color: var(--bg-tertiary-dark);
    border-color: var(--border-color-dark);
}

#configOptionsContainer[data-saved-state="draft"] {
    position: relative;
}

#configOptionsContainer[data-saved-state="draft"]::before {
    content: '';
    position: absolute;
    left: 21px;
    top: 16px;
    bottom: 16px;
    width: 2px;
    background: linear-gradient(180deg, rgba(56, 139, 253, 0.35) 0%, rgba(56, 139, 253, 0.08) 100%);
    pointer-events: none;
}

.config-sub-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-primary-light);
}

html[data-theme="dark"] .config-sub-card h3 {
    color: var(--text-primary-dark);
}

.config-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.config-card-title-group {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.config-card-step-badge {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
    position: relative;
    z-index: 1;
}

.config-card-title-copy {
    min-width: 0;
}

.config-card-step-label {
    display: inline-block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--accent-primary-light);
}

html[data-theme="dark"] .config-card-step-label {
    color: var(--accent-primary-dark);
}

.config-card-description {
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-secondary-light);
}

html[data-theme="dark"] .config-card-description {
    color: var(--text-secondary-dark);
}

.config-step-toggle {
    min-width: 96px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color-light);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text-primary-light);
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: none;
}

.config-step-toggle:hover {
    background: rgba(255, 255, 255, 0.96);
    transform: none;
}

html[data-theme="dark"] .config-step-toggle {
    background: rgba(22, 27, 34, 0.82);
    color: var(--text-primary-dark);
    border-color: var(--border-color-dark);
}

html[data-theme="dark"] .config-step-toggle:hover {
    background: rgba(33, 38, 45, 0.94);
}

.config-card-body {
    margin-top: 18px;
}

.config-sub-card-collapsed {
    border-style: dashed;
    opacity: 0.92;
}

.config-card-actions {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

html[data-theme="dark"] .config-card-actions {
    border-top-color: rgba(148, 163, 184, 0.18);
}

.config-next-button {
    min-width: 180px;
}

.config-card-action-hint {
    margin-bottom: 0;
}

#configOptionsContainer[data-saved-state="saved"] .config-next-button,
#configOptionsContainer[data-saved-state="saved"] .config-card-action-hint {
    display: none;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.form-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
    grid-column: span 12;
}

.form-item input:not([type="checkbox"]),
.form-item select,
.form-item textarea {
    max-width: 100%;
    min-width: 0;
}

.form-item-span-12 {
    grid-column: span 12;
}

.form-item-span-8 {
    grid-column: span 8;
}

.form-item-span-6 {
    grid-column: span 6;
}

.form-item-span-5 {
    grid-column: span 5;
}

.form-item-span-4 {
    grid-column: span 4;
}

.form-item-panel {
    height: 100%;
    padding: 18px;
    border-radius: calc(var(--input-border-radius) + 2px);
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

html[data-theme="dark"] .form-item-panel {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(13, 17, 23, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.form-item-nested {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.form-item label {
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary-light);
}

html[data-theme="dark"] .form-item label {
    color: var(--text-secondary-dark);
}

.config-toggle-label {
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 0;
    font-weight: 600;
    color: var(--text-primary-light);
}

html[data-theme="dark"] .config-toggle-label {
    color: var(--text-primary-dark);
}

.config-toggle-label span {
    flex: 1;
}

/* Custom Date Input Styles */
.date-range-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range-wrapper input[type="date"] {
    background-color: var(--bg-secondary-light);
    border: 1px solid var(--border-color-light);
    padding: 8px 10px;
    border-radius: var(--input-border-radius);
    font-family: inherit;
    color: var(--text-primary-light);
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    margin-bottom: 0; /* Override default */
}

html[data-theme="dark"] .date-range-wrapper input[type="date"] {
    background-color: var(--bg-secondary-dark);
    border-color: var(--border-color-dark);
    color: var(--text-primary-dark);
}

html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
}

.date-range-wrapper span {
    color: var(--text-muted-light);
}

html[data-theme="dark"] .date-range-wrapper span {
    color: var(--text-muted-dark);
}

/* Custom Select Styles */
.form-item select {
    margin-bottom: 0; /* Override default */
}

/* Keyword Input Styles */
.keyword-input-wrapper {
    margin-top: 12px;
}

.keyword-input-wrapper input {
    margin-bottom: 0;
}

.config-inline-panel {
    margin-top: 12px;
    padding: 14px;
    border-radius: var(--input-border-radius);
    background: rgba(0, 123, 255, 0.04);
    border: 1px dashed rgba(0, 123, 255, 0.2);
}

html[data-theme="dark"] .config-inline-panel {
    background: rgba(88, 166, 255, 0.05);
    border-color: rgba(88, 166, 255, 0.22);
}

.config-inline-panel > .form-item + .form-item {
    margin-top: 12px;
}

.config-inline-panel > .form-item-panel {
    padding: 0;
    height: auto;
    border: 0;
    background: transparent;
    box-shadow: none;
}

/* Checkbox Styles */
.form-item label.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
}

.form-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary-light);
}

html[data-theme="dark"] .form-item input[type="checkbox"] {
    accent-color: var(--accent-primary-dark);
}

.form-item-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
}

.button-group {
    margin-top: 25px;
    border-top: 1px solid var(--border-color-light);
    padding-top: 20px;
}

html[data-theme="dark"] .button-group {
    border-top-color: var(--border-color-dark);
}

.logs-entry-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logs-entry-row .w-100 {
    flex: 1;
}

.logs-help-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.help-icon-button {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border-color-light);
    background: var(--bg-secondary-light);
    color: var(--text-secondary-light);
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.help-icon-button:hover {
    background: var(--bg-tertiary-light);
    transform: none;
}

html[data-theme="dark"] .help-icon-button {
    background: var(--bg-secondary-dark);
    border-color: var(--border-color-dark);
    color: var(--text-primary-dark);
}

html[data-theme="dark"] .help-icon-button:hover {
    background: var(--bg-tertiary-dark);
}

.logs-help-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(320px, calc(100vw - 64px));
    padding: 12px 14px;
    border-radius: var(--card-border-radius);
    border: 1px solid var(--border-color-light);
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-primary-light);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    line-height: 1.6;
    z-index: 20;
}

html[data-theme="dark"] .logs-help-tooltip {
    background: rgba(24, 31, 42, 0.98);
    border-color: var(--border-color-dark);
    color: var(--text-primary-dark);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* User log access module */
#logAccessModule.card {
    position: relative;
    overflow: visible;
    padding: 22px;
    border: 1px solid rgba(164, 184, 228, 0.22);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 45px rgba(70, 84, 126, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.log-access-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.log-access-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.log-access-title-group {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 13px;
}

.log-access-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    color: #7c3aed;
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.15), rgba(79, 148, 244, 0.12));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.log-access-icon svg {
    width: 24px;
    height: 24px;
}

.log-access-title-copy {
    flex: 1 1 auto;
    min-width: 0;
}

#logAccessModule .log-access-title-copy h2 {
    margin: 0;
    color: #151b2d;
    font-size: 22px;
    font-weight: 850;
    line-height: 1.25;
}

.log-access-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 12px;
}

.log-access-description {
    margin: -2px 0 0;
    color: #5f687a;
    font-size: 14px;
    line-height: 1.55;
}

#logAccessModule .logs-entry-row {
    display: block;
}

#logAccessModule #viewLogsButton {
    min-height: 50px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(98deg, #7b5cff 0%, #6d67f5 50%, #4e94f4 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(92, 103, 245, 0.24);
}

#logAccessModule #viewLogsButton svg {
    width: 20px;
    height: 20px;
}

#logAccessModule #viewLogsButton:hover {
    background: linear-gradient(98deg, #704fff 0%, #625cf0 50%, #4388ec 100%);
}

#logAccessModule #viewLogsButton:disabled,
#logAccessModule #viewLogsButton:disabled:hover {
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(241, 244, 249, 0.9);
    color: #98a2b3;
    box-shadow: none;
    transform: none;
}

#logAccessModule .logs-help-trigger {
    flex: 0 0 auto;
}

#logAccessModule .help-icon-button {
    width: 36px;
    height: 36px;
    border-color: rgba(139, 92, 246, 0.18);
    background: rgba(255, 255, 255, 0.74);
    color: #7c3aed;
    box-shadow: 0 8px 18px rgba(80, 87, 132, 0.08);
}

#logAccessModule .help-icon-button svg {
    width: 20px;
    height: 20px;
}

#logAccessModule .help-icon-button:hover {
    border-color: rgba(139, 92, 246, 0.32);
    background: #ffffff;
    color: #6d28d9;
    box-shadow: 0 10px 22px rgba(80, 87, 132, 0.12);
}

#logAccessModule .logs-help-tooltip {
    width: min(310px, calc(100vw - 54px));
    border-color: rgba(139, 92, 246, 0.18);
    border-radius: 14px;
    color: #303653;
    font-size: 13px;
    box-shadow: 0 18px 40px rgba(86, 96, 148, 0.16);
}

html[data-theme="dark"] #logAccessModule.card {
    border-color: rgba(139, 148, 158, 0.24);
    background: rgba(22, 27, 34, 0.92);
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] #logAccessModule .log-access-title-copy h2 {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] .log-access-description {
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] .log-access-icon {
    background: rgba(167, 139, 250, 0.16);
    color: #c4b5fd;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] #logAccessModule .help-icon-button {
    border-color: rgba(167, 139, 250, 0.28);
    background: rgba(167, 139, 250, 0.14);
    color: #d8ccff;
    box-shadow: none;
}

html[data-theme="dark"] #logAccessModule .help-icon-button:hover {
    border-color: rgba(196, 181, 253, 0.46);
    background: rgba(167, 139, 250, 0.22);
    color: #ffffff;
}

html[data-theme="dark"] #logAccessModule .logs-help-tooltip {
    border-color: rgba(167, 139, 250, 0.24);
    background: rgba(22, 27, 34, 0.98);
    color: var(--text-primary-dark);
}

html[data-theme="dark"] #logAccessModule #viewLogsButton:disabled,
html[data-theme="dark"] #logAccessModule #viewLogsButton:disabled:hover {
    border-color: rgba(139, 148, 158, 0.24);
    background: rgba(13, 17, 23, 0.62);
    color: var(--disabled-text-dark);
}

@media (max-width: 768px) {
    #logAccessModule.card {
        padding: 19px 18px 18px;
        border-radius: 18px;
    }

    .log-access-header {
        gap: 10px;
    }

    .log-access-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 14px;
    }

    #logAccessModule .log-access-title-copy h2 {
        font-size: 18px;
    }

    .log-access-description {
        font-size: 13px;
    }

    #logAccessModule #viewLogsButton {
        min-height: 48px;
        font-size: 15px;
    }
}

/* Info hint card for config options */
.form-item-hint {
    padding: 10px;
    margin-top: 8px;
    border-radius: var(--input-border-radius);
    font-size: 0.8rem;
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info-light);
    border: 1px solid rgba(23, 162, 184, 0.2);
}

html[data-theme="dark"] .form-item-hint {
    background-color: rgba(56, 139, 253, 0.1);
    color: var(--info-dark);
    border-color: rgba(56, 139, 253, 0.2);
}

.config-inline-hint {
    margin-top: 12px;
}

.config-module-footer-hint {
    max-width: 960px;
    margin: 20px auto 0;
    padding: 14px 18px;
    border-radius: calc(var(--input-border-radius) + 2px);
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.75;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.08), rgba(23, 162, 184, 0.08));
    color: var(--text-secondary-light);
    border: 1px solid rgba(0, 123, 255, 0.18);
}

html[data-theme="dark"] .config-module-footer-hint {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.12), rgba(56, 139, 253, 0.08));
    color: var(--text-primary-dark);
    border-color: rgba(88, 166, 255, 0.22);
}

/* Refined user configuration cards */
#configOptionsContainer {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#configOptionsContainer[data-saved-state="draft"] {
    padding-left: 18px;
}

#configOptionsContainer[data-saved-state="draft"]::before {
    left: 18px;
    top: 26px;
    bottom: 26px;
    width: 1px;
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.45), rgba(245, 158, 11, 0.22), rgba(37, 99, 235, 0.12));
}

.config-sub-card {
    --config-tone: #2563eb;
    --config-tone-soft: rgba(37, 99, 235, 0.1);
    --config-tone-line: rgba(37, 99, 235, 0.28);
    padding: 0;
    margin-bottom: 0;
    overflow: hidden;
    border-radius: 8px;
    border-color: rgba(148, 163, 184, 0.26);
    border-left: 4px solid var(--config-tone);
    background:
        linear-gradient(90deg, var(--config-tone-soft), transparent 28%),
        rgba(255, 255, 255, 0.72);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

html[data-theme="dark"] .config-sub-card {
    border-color: rgba(148, 163, 184, 0.18);
    border-left-color: var(--config-tone);
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent 34%),
        rgba(22, 27, 34, 0.82);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.config-tone-delete-posts {
    --config-tone: #dc2626;
    --config-tone-soft: rgba(220, 38, 38, 0.08);
    --config-tone-line: rgba(220, 38, 38, 0.24);
}

.config-tone-private {
    --config-tone: #d97706;
    --config-tone-soft: rgba(217, 119, 6, 0.09);
    --config-tone-line: rgba(217, 119, 6, 0.24);
}

.config-tone-unfollow {
    --config-tone: #0f766e;
    --config-tone-soft: rgba(15, 118, 110, 0.09);
    --config-tone-line: rgba(15, 118, 110, 0.24);
}

.config-tone-followers {
    --config-tone: #7c3aed;
    --config-tone-soft: rgba(124, 58, 237, 0.08);
    --config-tone-line: rgba(124, 58, 237, 0.22);
}

.config-tone-likes {
    --config-tone: #db2777;
    --config-tone-soft: rgba(219, 39, 119, 0.08);
    --config-tone-line: rgba(219, 39, 119, 0.22);
}

.config-tone-comments {
    --config-tone: #2563eb;
    --config-tone-soft: rgba(37, 99, 235, 0.08);
    --config-tone-line: rgba(37, 99, 235, 0.22);
}

.config-sub-card-active {
    border-color: var(--config-tone-line);
    transform: translateX(2px);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="dark"] .config-sub-card-active {
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.config-sub-card-collapsed {
    border-style: solid;
    opacity: 1;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.055);
}

html[data-theme="dark"] .config-sub-card-collapsed {
    background: rgba(22, 27, 34, 0.58);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.config-card-header {
    align-items: center;
    padding: 18px 20px;
}

.config-card-title-group {
    align-items: center;
    gap: 16px;
}

.config-card-step-badge {
    width: 36px;
    height: 36px;
    background: var(--config-tone);
    box-shadow: 0 12px 26px var(--config-tone-line);
}

.config-card-title-copy h3 {
    line-height: 1.25;
}

.config-card-step-label {
    color: var(--config-tone);
    letter-spacing: 0;
}

html[data-theme="dark"] .config-card-step-label {
    color: var(--config-tone);
}

.config-card-description {
    max-width: 720px;
    margin-top: 6px;
}

.config-step-toggle {
    min-width: 88px;
    border-color: var(--config-tone-line);
    background: rgba(255, 255, 255, 0.76);
    color: var(--config-tone);
}

.config-step-toggle:hover {
    background: var(--config-tone-soft);
    color: var(--config-tone);
}

html[data-theme="dark"] .config-step-toggle {
    border-color: var(--config-tone-line);
    color: var(--config-tone);
}

html[data-theme="dark"] .config-step-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.config-card-body {
    margin-top: 0;
    padding: 0 20px 20px 72px;
}

.form-grid {
    gap: 14px;
}

.form-item-panel {
    padding: 16px;
    border-radius: 8px;
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.64);
    box-shadow: none;
}

.form-item-panel:focus-within {
    border-color: var(--config-tone-line);
    box-shadow: 0 0 0 3px var(--config-tone-soft);
}

html[data-theme="dark"] .form-item-panel {
    background: rgba(13, 17, 23, 0.24);
}

.form-item label {
    margin-bottom: 7px;
    font-weight: 650;
    color: var(--text-primary-light);
}

html[data-theme="dark"] .form-item label {
    color: var(--text-primary-dark);
}

.form-item-hint {
    padding: 0;
    margin-top: 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted-light);
    line-height: 1.65;
}

html[data-theme="dark"] .form-item-hint {
    background: transparent;
    color: var(--text-secondary-dark);
    border-color: transparent;
}

.config-inline-panel {
    padding: 14px;
    border-radius: 8px;
    background: var(--config-tone-soft);
    border-color: var(--config-tone-line);
}

.config-card-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding-top: 16px;
    border-top-color: rgba(148, 163, 184, 0.2);
}

.config-card-actions .form-item-hint {
    margin-top: 0;
}

.config-next-button {
    flex-shrink: 0;
    border-color: var(--config-tone-line);
    color: var(--config-tone);
}

.config-next-button:hover {
    background: var(--config-tone-soft);
    color: var(--config-tone);
}

.config-module-footer-hint {
    border-radius: 8px;
}

@media (max-width: 1199px) {
    .form-item-span-8,
    .form-item-span-6,
    .form-item-span-5,
    .form-item-span-4 {
        grid-column: span 6;
    }
}

@media (max-width: 767px) {
    .welcome-panel {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .welcome-copy {
        padding-right: 0;
    }

    .welcome-copy h2 {
        font-size: 1.18rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .form-item,
    .form-item-span-12,
    .form-item-span-8,
    .form-item-span-6,
    .form-item-span-5,
    .form-item-span-4 {
        grid-column: 1 / -1;
    }

    .form-item-panel {
        padding: 16px;
    }

    #configOptionsContainer[data-saved-state="draft"] {
        padding-left: 0;
    }

    #configOptionsContainer[data-saved-state="draft"]::before {
        display: none;
    }

    .config-card-body {
        padding: 0 16px 16px;
    }

    .config-card-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .config-next-button {
        width: 100%;
    }

    .config-module-footer-hint {
        margin-top: 18px;
        padding: 12px 14px;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .welcome-panel {
        padding: 16px;
    }

    .config-card-header {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .config-card-title-group {
        gap: 12px;
    }

    .config-step-toggle {
        width: 100%;
    }

    .date-range-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .date-range-wrapper span {
        display: none; /* Hide the "to" text on mobile */
    }

    .pagination-controls {
        gap: 10px; /* Reduce gap on mobile */
    }

    /* Force a line break after the page info span */
    .pagination-controls .page-info {
        flex-basis: 100%;
        text-align: center;
        order: -1; /* Move page info to the top */
        margin-bottom: 10px;
    }

    .operation-stats-header {
        flex-direction: column;
        align-items: stretch;
    }

    .operation-stats-actions {
        width: 100%;
    }

    .operation-stats-actions button {
        flex: 1;
    }

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

@media (prefers-reduced-motion: reduce) {
    .welcome-panel,
    .welcome-panel::after {
        animation: none;
    }
}

/* --- Dropdown Menu Styles --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown .dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--bg-secondary-light);
    min-width: 220px; /* Increased width for longer text */
    box-shadow: var(--card-shadow-light);
    border-radius: var(--input-border-radius);
    border: 1px solid var(--border-color-light);
    z-index: 9999;
    overflow: hidden;
    padding: 5px 0;
}

.dropdown .dropdown-content.show {
    display: block;
    animation: fadeIn 0.15s ease-out;
}

.dropdown .dropdown-content a {
    color: var(--text-primary-light);
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 0.875rem;
    transition: background-color var(--transition-fast);
}

.dropdown .dropdown-content a:hover {
    background-color: var(--bg-tertiary-light);
}

.dropdown .dropdown-content a.dropdown-item-disabled {
    color: var(--disabled-text-light);
    cursor: not-allowed;
}

.dropdown .dropdown-content a.dropdown-item-disabled:hover {
    background-color: transparent;
}

/* Dark Theme for Dropdown */
html[data-theme="dark"] .dropdown .dropdown-content {
    background-color: var(--bg-secondary-dark);
    box-shadow: var(--card-shadow-dark);
    border-color: var(--border-color-dark);
}

html[data-theme="dark"] .dropdown .dropdown-content a {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] .dropdown .dropdown-content a:hover {
    background-color: var(--bg-tertiary-dark);
}

html[data-theme="dark"] .dropdown .dropdown-content a.dropdown-item-disabled {
    color: var(--disabled-text-dark);
}

/* Ensure actions cell buttons have consistent spacing */
td.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.operation-stats-card {
    gap: 12px;
}

.operation-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.operation-stats-header h3 {
    margin-bottom: 8px;
}

.operation-stats-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.operation-stats-loading {
    min-height: 120px;
    align-items: center;
    justify-content: center;
}

.operation-stats-content {
    overflow-y: auto;
}

.operation-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.operation-stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--border-color-light);
    border-radius: var(--input-border-radius);
    background-color: var(--bg-tertiary-light);
}

.operation-stat-item label {
    margin-bottom: 0;
    font-weight: 600;
}

.operation-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-primary-light);
}

.operation-stat-item input[type="number"] {
    margin-bottom: 0;
}

html[data-theme="dark"] .operation-stat-item {
    border-color: var(--border-color-dark);
    background-color: var(--bg-tertiary-dark);
}

html[data-theme="dark"] .operation-stat-value {
    color: var(--accent-primary-dark);
}

/* --- Modern Log View Styles --- */
#logContent {
    background-color: #0d1117 !important; /* Fixed dark background */
    color: #c9d1d9 !important; /* Light text color */
    font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
    font-size: 0.85rem;
    padding: 15px; /* Restore padding */
    border: 1px solid #30363d !important;
    line-height: 1.5; /* Adjust line height for readability */
    white-space: pre-wrap; /* Ensure wrapping */
    word-break: break-word; /* Ensure long words break */
}

/* Override spinner color for the dark log view, regardless of theme */
#logContent .spinner {
    border-color: #21262d;
    border-top-color: #58a6ff;
}

.log-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.log-modal-jump-actions,
.log-modal-main-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Card Header for Toggle Button */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px; /* Same as h2 margin-bottom */
}

.card-header h2 {
    margin-bottom: 0; /* Remove margin from h2 inside header */
}

.toggle-button {
    background: none;
    border: 1px solid var(--border-color-light); /* 在明亮模式下添加边框 */
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast), transform var(--transition-smooth), border-color var(--transition-fast);
}

.toggle-button:hover {
    background-color: var(--bg-tertiary-light);
    transform: none; /* Override default button hover transform */
}

html[data-theme="dark"] .toggle-button {
    border-color: var(--border-color-dark); /* 在暗黑模式下添加边框 */
}

html[data-theme="dark"] .toggle-button:hover {
    background-color: var(--bg-tertiary-dark);
}

.toggle-button svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary-light);
    transition: transform var(--transition-smooth);
}

html[data-theme="dark"] .toggle-button svg {
    color: var(--text-primary-dark); /* 在暗黑模式下使用更亮的颜色 */
}

/* Collapsed State */
#configModule.config-collapsed .icon-chevron-up {
    transform: rotate(180deg);
}

#configContent {
    max-height: none; /* JS will sync the expanded height to the actual content size */
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                opacity 0.3s ease-in-out 0.1s,
                margin-top 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    opacity: 1;
    margin-top: 0;
}

#configModule.config-collapsed #configContent {
    max-height: 0;
    opacity: 0;
    margin-top: -20px; /* Pull up the bottom border */
    transition: max-height 0.4s cubic-bezier(0.65, 0, 0.35, 1),
                opacity 0.2s ease-in-out,
                margin-top 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Styles for the new collapsible feature */
#configModule.config-collapsed .config-options-container,
#configModule.config-collapsed .config-footer {
    display: none;
}

/* --- Header Action Buttons --- */
.header-actions-container {
    position: fixed; /* 改为 fixed 以便随页面滑动而固定 */
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 999px;
    padding: 5px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: background-color var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
    z-index: 1000; /* 确保菜单在最上层 */
}

html[data-theme="dark"] .header-actions-container {
    background: rgba(13, 17, 23, 0.76);
    border-color: rgba(139, 148, 158, 0.3);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.action-btn {
    position: relative;
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary-light);
    transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    padding: 0; /* Reset padding */
}

.action-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    color: var(--accent-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 123, 255, 0.14);
}

/* 为暗黑模式下的 action-btn 添加默认背景色 */
html[data-theme="dark"] .action-btn {
    background: transparent;
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] .action-btn:hover {
    background: rgba(88, 166, 255, 0.14);
    color: var(--accent-primary-dark);
    box-shadow: 0 8px 18px rgba(88, 166, 255, 0.12);
}

.action-btn svg {
    width: 20px;
    height: 20px;
    color: currentColor;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

html[data-theme="dark"] .action-btn svg {
    color: currentColor;
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:hover svg {
    transform: scale(1.06);
}

@media (max-width: 768px) {
    .header-actions-container {
        top: calc(10px + env(safe-area-inset-top));
        right: calc(10px + env(safe-area-inset-right));
        padding: 4px;
    }

    .action-btn {
        width: 34px;
        height: 34px;
    }

    .action-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* --- Dropdown Menu for Header Actions --- */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none; /* 默认隐藏 */
    position: absolute;
    right: 0;
    top: calc(100% + 5px); /* 定位在按钮下方 */
    background-color: var(--bg-secondary-light);
    min-width: 160px;
    box-shadow: var(--card-shadow-light);
    border-radius: var(--input-border-radius);
    border: 1px solid var(--border-color-light);
    z-index: 1001; /* 确保在 header-actions-container 之上 */
    overflow: hidden;
    padding: 5px 0;
    animation: fadeIn 0.15s ease-out;
}

.dropdown-menu.show {
    display: block; /* JS控制显示 */
}

.dropdown-menu a {
    color: var(--text-primary-light);
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 0.875rem;
    transition: background-color var(--transition-fast);
}

.dropdown-menu a:hover {
    background-color: var(--bg-tertiary-light);
}

/* Dark Theme for Dropdown Menu */
html[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-secondary-dark);
    box-shadow: var(--card-shadow-dark);
    border-color: var(--border-color-dark);
}

html[data-theme="dark"] .dropdown-menu a {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] .dropdown-menu a:hover {
    background-color: var(--bg-tertiary-dark);
}

/* --- Custom Scrollbar Styling --- */

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #007bff transparent; /* thumb color, track color */
}

/* For Webkit browsers (Chrome, Safari, iOS) */
/* This targets the scrollbar of the whole page and any scrollable div */
body::-webkit-scrollbar,
div::-webkit-scrollbar,
#logContent::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 8px;
    height: 8px;
}

body::-webkit-scrollbar-track,
div::-webkit-scrollbar-track,
#logContent::-webkit-scrollbar-track {
    background: transparent;
}

body::-webkit-scrollbar-thumb,
div::-webkit-scrollbar-thumb,
#logContent::-webkit-scrollbar-thumb {
    background-color: #007bff;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

body::-webkit-scrollbar-thumb:hover,
div::-webkit-scrollbar-thumb:hover,
#logContent::-webkit-scrollbar-thumb:hover {
    background-color: #0056b3;
}

#configModule.card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#configModule > .card-header {
    display: none;
}

#configContent {
    overflow: visible;
}

#configOptionsContainer {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#configOptionsContainer[data-saved-state="draft"] {
    padding-left: 0;
}

#configOptionsContainer[data-saved-state="draft"]::before {
    display: none;
}

.config-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-native-select-hidden {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0 !important;
}

.config-segment-control {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
    overflow-x: auto;
}

.config-segment-option {
    min-height: 28px;
    padding: 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 7px;
    background: #f8f9ff;
    color: #2e3545;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: none;
}

.config-segment-option:hover {
    border-color: rgba(139, 92, 246, 0.38);
    background: rgba(139, 92, 246, 0.08);
    color: #7c3aed;
    transform: none;
    box-shadow: none;
}

.config-segment-option.is-active {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

html[data-theme="dark"] .config-segment-option {
    border-color: rgba(167, 139, 250, 0.28);
    background: rgba(13, 17, 23, 0.68);
    color: #d8dfff;
}

html[data-theme="dark"] .config-segment-option:hover {
    border-color: rgba(167, 139, 250, 0.58);
    background: rgba(139, 92, 246, 0.2);
    color: #ddd6fe;
    transform: none;
    box-shadow: none;
}

html[data-theme="dark"] .config-segment-option.is-active,
html[data-theme="dark"] .config-segment-option.is-active:hover {
    border-color: rgba(167, 139, 250, 0.78);
    background: linear-gradient(135deg, #7c3aed, #5b7cfa);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(92, 103, 245, 0.22);
    transform: none;
}

#configModule .config-module-footer-hint {
    display: none;
}

#configModule .button-group {
    position: relative;
    z-index: 2;
    margin: -60px 20px 0;
}

#configModule #saveConfigButton {
    min-height: 42px;
    border-radius: 999px;
    background: linear-gradient(100deg, #7d4cff 0%, #9c4ff2 48%, #b657e6 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(139, 92, 246, 0.25);
}

#configModule #saveConfigButton:hover {
    background: linear-gradient(100deg, #7442f5 0%, #9145e8 48%, #aa4edc 100%);
    transform: translateY(-1px);
}

#configModule #saveConfigButton:disabled {
    background: #eef0f6;
    color: #a3aab8;
    box-shadow: none;
}

.config-tone-delete-posts {
    --config-tone: #8b5cf6;
    --config-tone-soft: rgba(139, 92, 246, 0.13);
    --config-tone-line: rgba(139, 92, 246, 0.32);
}

.config-tone-private {
    --config-tone: #f59e0b;
    --config-tone-soft: rgba(245, 158, 11, 0.14);
    --config-tone-line: rgba(245, 158, 11, 0.28);
}

.config-tone-unfollow {
    --config-tone: #3b82f6;
    --config-tone-soft: rgba(59, 130, 246, 0.14);
    --config-tone-line: rgba(59, 130, 246, 0.28);
}

.config-tone-followers {
    --config-tone: #10b981;
    --config-tone-soft: rgba(16, 185, 129, 0.14);
    --config-tone-line: rgba(16, 185, 129, 0.28);
}

.config-tone-likes {
    --config-tone: #ef6aa3;
    --config-tone-soft: rgba(239, 106, 163, 0.14);
    --config-tone-line: rgba(239, 106, 163, 0.28);
}

.config-tone-comments {
    --config-tone: #22c55e;
    --config-tone-soft: rgba(34, 197, 94, 0.14);
    --config-tone-line: rgba(34, 197, 94, 0.28);
}

@media (max-width: 768px) {
    .config-segment-control {
        justify-content: flex-start;
    }

    #configModule .button-group {
        margin: -58px 16px 0;
    }

    body.user-entry-page {
        padding: calc(22px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(34px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
    }

    .user-entry-page .container {
        padding: 0;
    }

    .user-login-hero {
        min-height: 252px;
        padding: 20px 0 0;
        grid-template-columns: minmax(0, 1fr) 202px;
    }

    .user-login-hero h1 {
        font-size: 34px;
        line-height: 1.32;
    }

    .user-login-hero .subtitle {
        margin-top: 18px;
        font-size: 16px;
    }

    .user-login-benefits {
        gap: 18px;
        margin-top: 21px;
    }

    .user-login-benefit {
        gap: 7px;
        font-size: 14px;
    }

    .user-login-benefit svg {
        width: 18px;
        height: 18px;
    }

    .user-login-hero-art {
        height: 226px;
        transform: scale(0.84);
        transform-origin: right center;
    }

    .key-entry-card.card {
        padding: 23px 24px 22px;
    }
}

@media (max-width: 600px) {
    .user-login-hero {
        min-height: 314px;
        grid-template-columns: 1fr;
        align-items: start;
        overflow: hidden;
    }

    .user-login-hero-copy {
        max-width: 360px;
    }

    .user-login-hero h1 {
        font-size: 31px;
    }

    .user-login-hero .subtitle {
        font-size: 15px;
    }

    .user-login-benefits {
        max-width: 315px;
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .user-login-hero-art {
        position: absolute;
        right: -28px;
        bottom: -4px;
        width: 246px;
        height: 220px;
        opacity: 0.9;
        transform: scale(0.75);
        transform-origin: right bottom;
    }

    .hero-heart-left,
    .hero-sparkle-left,
    .hero-card-chat {
        opacity: 0.35;
    }
}

@media (max-width: 480px) {
    .config-card-title-row {
        flex-wrap: wrap;
    }

    .user-entry-page .theme-switch-button {
        top: calc(10px + env(safe-area-inset-top));
        right: calc(10px + env(safe-area-inset-right));
    }

    .user-login-hero {
        min-height: 300px;
        padding-top: 18px;
    }

    .user-login-hero h1 {
        font-size: 29px;
    }

    .user-login-benefits {
        gap: 14px;
    }

    .key-entry-card.card {
        padding: 23px 20px 21px;
        border-radius: 18px;
    }

    .key-input-shell {
        height: 54px;
        padding: 0 16px;
    }

    .weibo-login-button {
        min-height: 58px;
        font-size: 18px;
    }

    .key-entry-privacy {
        align-items: flex-start;
        font-size: 13px;
    }
}

/* Required feature configuration: every rendered card is mandatory. */
#configOptionsContainer > .config-sub-card {
    --config-tone: #8b5cf6;
    --config-tone-soft: rgba(139, 92, 246, 0.12);
    --config-tone-line: rgba(139, 92, 246, 0.24);
    display: block;
    padding: 0;
    margin: 0 0 18px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-left: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 38px rgba(72, 83, 120, 0.08);
    transform: none;
}

#configOptionsContainer > .config-sub-card:last-child {
    margin-bottom: 0;
}

#configOptionsContainer > .config-sub-card-active,
#configOptionsContainer > .config-sub-card-collapsed {
    display: block;
    transform: none;
}

#configOptionsContainer > .config-sub-card .config-card-header {
    padding: 19px 20px 14px;
    align-items: center;
    border-bottom: 0;
}

#configOptionsContainer > .config-sub-card .config-card-title-group {
    gap: 12px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-width: 0;
}

#configOptionsContainer > .config-sub-card .config-card-step-badge {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--config-tone-soft);
    color: var(--config-tone);
    box-shadow: none;
}

#configOptionsContainer > .config-sub-card .config-card-step-badge svg {
    width: 19px;
    height: 19px;
}

#configOptionsContainer > .config-sub-card .config-card-title-copy {
    min-width: 0;
    flex: 1 1 auto;
}

#configOptionsContainer > .config-sub-card .config-card-title-copy h3 {
    margin: 0;
    color: var(--config-tone);
    font-size: 20px;
    font-weight: 850;
    line-height: 1.25;
}

#configOptionsContainer > .config-sub-card .config-card-description {
    margin-top: 4px;
    max-width: none;
    color: #777f90;
    font-size: 14px;
    font-weight: 500;
}

#configOptionsContainer > .config-sub-card .config-step-toggle {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f5f6fb;
    color: #6f7787;
}

#configOptionsContainer > .config-sub-card .config-step-toggle:hover {
    background: #eef0f8;
    box-shadow: none;
    transform: none;
}

#configOptionsContainer > .config-sub-card.config-sub-card-collapsed .config-step-toggle svg {
    transform: rotate(180deg);
}

#configOptionsContainer > .config-sub-card .config-step-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

#configOptionsContainer > .config-sub-card .config-card-body {
    padding: 0 20px 20px;
}

#configOptionsContainer > .config-sub-card .form-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 11px;
    background: #ffffff;
}

#configOptionsContainer > .config-sub-card .form-item,
#configOptionsContainer > .config-sub-card .form-item-span-12,
#configOptionsContainer > .config-sub-card .form-item-span-8,
#configOptionsContainer > .config-sub-card .form-item-span-6,
#configOptionsContainer > .config-sub-card .form-item-span-5,
#configOptionsContainer > .config-sub-card .form-item-span-4 {
    grid-column: auto;
}

#configOptionsContainer > .config-sub-card .form-item-panel {
    min-height: 48px;
    margin: 0;
    padding: 12px 13px;
    display: grid;
    grid-template-columns: minmax(116px, 0.58fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
}

#configOptionsContainer > .config-sub-card .form-item-panel:last-child {
    border-bottom: 0;
}

#configOptionsContainer > .config-sub-card .form-item-panel:focus-within {
    border-color: rgba(148, 163, 184, 0.14);
    box-shadow: inset 3px 0 0 var(--config-tone);
}

#configOptionsContainer > .config-sub-card .form-item label {
    margin: 0;
    color: #2e3545;
    font-size: 14px;
    font-weight: 800;
}

#configOptionsContainer > .config-sub-card .config-toggle-label,
#configOptionsContainer > .config-sub-card .form-item > label:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#configOptionsContainer > .config-sub-card .form-item-hint {
    grid-column: 2;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #8a92a1;
    font-size: 13px;
    line-height: 1.45;
    text-align: right;
}

#configOptionsContainer > .config-sub-card .config-inline-panel {
    grid-column: 1 / -1;
    margin-top: 10px;
    padding: 12px;
    border-radius: 10px;
    background: #f8f9ff;
    border-color: rgba(148, 163, 184, 0.16);
}

#configOptionsContainer > .config-sub-card select,
#configOptionsContainer > .config-sub-card input[type="email"],
#configOptionsContainer > .config-sub-card input[type="text"],
#configOptionsContainer > .config-sub-card input[type="date"] {
    min-height: 36px;
    margin: 0;
    border-color: rgba(148, 163, 184, 0.18);
    border-radius: 9px;
    background: #f8f9ff;
    color: #343b4a;
    font-size: 14px;
}

#configOptionsContainer > .config-sub-card .date-range-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

#configOptionsContainer > .config-sub-card .form-item-checkbox-group {
    justify-content: flex-end;
    gap: 8px;
}

#configOptionsContainer > .config-sub-card .form-item-checkbox-group .checkbox-label {
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: #f8f9ff;
}

#configOptionsContainer > .config-sub-card .config-card-actions {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 0;
}

#configOptionsContainer > .config-sub-card .config-next-button {
    min-height: 36px;
    border-radius: 999px;
    border-color: var(--config-tone-line);
    color: var(--config-tone);
}

#configModule .button-group {
    margin: 18px 0 0;
}

#configModule #saveConfigButton {
    min-height: 42px;
    border-radius: 999px;
    background: linear-gradient(100deg, #7d4cff 0%, #9c4ff2 48%, #b657e6 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(139, 92, 246, 0.25);
}

#configModule #saveConfigButton:hover {
    background: linear-gradient(100deg, #7442f5 0%, #9145e8 48%, #aa4edc 100%);
    transform: translateY(-1px);
}

#configModule #saveConfigButton:disabled {
    background: #eef0f6;
    color: #a3aab8;
    box-shadow: none;
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card .form-grid,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card .form-item-panel {
    background: rgba(22, 27, 34, 0.86);
    border-color: rgba(139, 148, 158, 0.2);
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card .form-item label,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card select,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card input[type="email"],
html[data-theme="dark"] #configOptionsContainer > .config-sub-card input[type="text"],
html[data-theme="dark"] #configOptionsContainer > .config-sub-card input[type="date"] {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-card-description,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card .form-item-hint {
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-step-toggle,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card select,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card input[type="email"],
html[data-theme="dark"] #configOptionsContainer > .config-sub-card input[type="text"],
html[data-theme="dark"] #configOptionsContainer > .config-sub-card input[type="date"],
html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-inline-panel,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card .form-item-checkbox-group .checkbox-label {
    background: rgba(13, 17, 23, 0.58);
    border-color: rgba(139, 148, 158, 0.2);
}

@media (max-width: 768px) {
    #configOptionsContainer > .config-sub-card .config-card-header {
        padding: 17px 16px 13px;
    }

    #configOptionsContainer > .config-sub-card .config-card-body {
        padding: 0 16px 16px;
    }

    #configOptionsContainer > .config-sub-card .form-item-panel {
        grid-template-columns: 1fr;
        gap: 8px;
        align-items: stretch;
    }

    #configOptionsContainer > .config-sub-card .form-item-hint {
        grid-column: 1;
        text-align: left;
    }

    #configModule .button-group {
        margin-top: 16px;
    }
}

@media (max-width: 480px) {
    #configOptionsContainer > .config-sub-card .config-card-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }

    #configOptionsContainer > .config-sub-card .config-card-title-group {
        min-width: 0;
        flex: 1 1 auto;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: flex-start;
    }

    #configOptionsContainer > .config-sub-card .config-card-step-badge {
        flex: 0 0 32px;
    }

    #configOptionsContainer > .config-sub-card .config-card-title-copy {
        min-width: 0;
        flex: 1 1 auto;
    }

    #configOptionsContainer > .config-sub-card .config-step-toggle {
        align-self: flex-start;
        flex: 0 0 34px;
        margin-top: 0;
    }

    #configOptionsContainer > .config-sub-card .config-card-title-row {
        flex-wrap: wrap;
    }

    #configOptionsContainer > .config-sub-card .date-range-wrapper {
        grid-template-columns: 1fr;
    }

    #configOptionsContainer > .config-sub-card .date-range-wrapper span {
        display: none;
    }
}

/* Keep the user entry card fluid on narrow screens. */
@media (max-width: 600px) {
    body.user-entry-page {
        width: 100%;
        overflow-x: hidden;
    }

    .user-entry-page .container,
    .user-entry-page .key-entry-card.card,
    .user-entry-page .key-input-shell,
    .user-entry-page .weibo-login-button {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .user-entry-page .container {
        margin-left: auto;
        margin-right: auto;
    }

    .user-entry-page .key-entry-card.card {
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    .user-entry-page .weibo-login-button,
    .user-entry-page .weibo-login-button span {
        white-space: nowrap;
        writing-mode: horizontal-tb;
    }
}

/* Guided single-card configuration wizard. */
#configModule.card {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 25px;
}

#configOptionsContainer {
    gap: 0;
}

#configOptionsContainer > .config-sub-card[hidden],
#configOptionsContainer > .config-sub-card.config-step-hidden {
    display: none !important;
}

#configOptionsContainer > .config-sub-card.config-step-visible {
    display: block;
}

#configOptionsContainer > .config-sub-card {
    position: relative;
    margin: 0;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 55px rgba(80, 87, 132, 0.12);
}

#configOptionsContainer > .config-sub-card .config-card-header {
    min-height: 132px;
    padding: 26px 30px 22px;
    background:
        linear-gradient(120deg, rgba(139, 92, 246, 0.13), rgba(255, 255, 255, 0.82) 56%, rgba(255, 255, 255, 0.96)),
        #ffffff;
}

#configOptionsContainer > .config-sub-card .config-card-title-group {
    gap: 20px;
    align-items: center;
}

#configOptionsContainer > .config-sub-card .config-card-step-badge {
    width: 76px;
    height: 76px;
    flex-basis: 76px;
    border-radius: 50%;
    background: linear-gradient(145deg, #a875ff 0%, #7c3aed 100%);
    color: #ffffff;
    box-shadow: 0 18px 36px rgba(124, 58, 237, 0.28);
}

#configOptionsContainer > .config-sub-card .config-card-step-badge svg {
    width: 38px;
    height: 38px;
}

#configOptionsContainer > .config-sub-card .config-card-step-label {
    display: block;
    margin-bottom: 5px;
    color: #8b5cf6;
    font-size: 13px;
    font-weight: 800;
}

#configOptionsContainer > .config-sub-card .config-card-title-copy h3 {
    color: #161c32;
    font-size: 26px;
    line-height: 1.22;
}

#configOptionsContainer > .config-sub-card .config-card-description {
    margin-top: 8px;
    color: #606a7f;
    font-size: 16px;
    line-height: 1.45;
}

#configOptionsContainer > .config-sub-card .config-step-toggle {
    width: 38px;
    min-width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.72);
    color: #1e2841;
    box-shadow: 0 8px 18px rgba(80, 87, 132, 0.08);
}

#configOptionsContainer > .config-sub-card .config-card-body {
    padding: 26px 30px 30px;
}

#configOptionsContainer > .config-sub-card .config-card-body::before {
    content: "参数配置";
    display: block;
    margin-bottom: 18px;
    padding-left: 12px;
    border-left: 5px solid #8b5cf6;
    color: #151b2d;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.15;
}

#configOptionsContainer > .config-sub-card .form-grid {
    gap: 14px;
    border: 0;
    background: transparent;
    overflow: visible;
}

#configOptionsContainer > .config-sub-card .form-item-panel {
    min-height: 78px;
    padding: 15px 17px;
    grid-template-columns: minmax(150px, 0.55fr) minmax(0, 1fr);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(80, 87, 132, 0.06);
}

#configOptionsContainer > .config-sub-card .form-item-panel:focus-within {
    border-color: rgba(139, 92, 246, 0.34);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.08), 0 10px 24px rgba(80, 87, 132, 0.06);
}

#configOptionsContainer > .config-sub-card .form-item label {
    color: #182033;
    font-size: 16px;
}

#configOptionsContainer > .config-sub-card .form-item-panel.weibo-backup-option {
    grid-template-columns: 1fr;
}

#configOptionsContainer > .config-sub-card .weibo-backup-option .config-toggle-label {
    grid-column: 1;
    width: max-content;
    max-width: 100%;
    flex-wrap: nowrap;
}

#configOptionsContainer > .config-sub-card .weibo-backup-option .config-toggle-text {
    flex: 0 0 auto;
    white-space: nowrap;
}

#configOptionsContainer > .config-sub-card .weibo-backup-option .weibo-backup-email-wrapper {
    grid-column: 1;
}

#configOptionsContainer > .config-sub-card .weibo-backup-option .weibo-backup-hint {
    margin-top: 10px;
    color: #697389;
    font-size: 13px;
    line-height: 1.7;
    text-align: left;
}

#configOptionsContainer > .config-sub-card .config-free-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 20px;
    padding: 2px 7px;
    border: 1px solid rgba(16, 185, 129, 0.28);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

#configOptionsContainer > .config-sub-card .form-item-hint {
    color: #697389;
    font-size: 13px;
}

#configOptionsContainer > .config-sub-card select,
#configOptionsContainer > .config-sub-card input[type="email"],
#configOptionsContainer > .config-sub-card input[type="text"],
#configOptionsContainer > .config-sub-card input[type="date"] {
    min-height: 42px;
    border-radius: 11px;
    background: #fbfbff;
    color: #182033;
}

#configOptionsContainer > .config-sub-card .config-inline-panel {
    margin-top: 12px;
    padding: 14px;
    border-radius: 13px;
    background: rgba(139, 92, 246, 0.06);
}

#configOptionsContainer > .config-sub-card .config-card-guide-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid rgba(139, 92, 246, 0.17);
    border-radius: 16px;
    background: linear-gradient(100deg, rgba(139, 92, 246, 0.1), rgba(167, 139, 250, 0.08));
    color: #303653;
}

#configOptionsContainer > .config-sub-card .config-card-guide-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    color: #8b5cf6;
}

#configOptionsContainer > .config-sub-card .config-card-guide-icon svg {
    width: 100%;
    height: 100%;
}

#configOptionsContainer > .config-sub-card .config-card-guide-panel strong {
    display: block;
    color: #202742;
    font-size: 16px;
    font-weight: 850;
    line-height: 1.35;
}

#configOptionsContainer > .config-sub-card .config-card-guide-panel p {
    margin: 4px 0 0;
    color: #5f6681;
    font-size: 14px;
    line-height: 1.5;
}

.config-wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    margin: 14px 0 10px;
}

.config-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #dfe2ec;
    transition: width var(--transition-fast), background-color var(--transition-fast), opacity var(--transition-fast);
}

.config-progress-dot.is-active {
    width: 24px;
    background: #8b5cf6;
}

.config-progress-dot.is-complete:not(.is-active) {
    background: rgba(139, 92, 246, 0.28);
}

#configModule .config-wizard-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
}

#configModule #saveConfigButton {
    min-height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 999px;
    font-size: 20px;
    letter-spacing: 0;
}

#configModule #saveConfigButton::before {
    content: "→";
    font-size: 28px;
    line-height: 1;
}

#configModule #saveConfigButton:disabled::before {
    content: "";
}

#configModule .config-back-button {
    min-height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #1d2742;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(80, 87, 132, 0.06);
}

#configModule .config-back-button:hover {
    border-color: rgba(139, 92, 246, 0.28);
    background: #ffffff;
    color: #7c3aed;
    transform: translateY(-1px);
}

#configModule .config-back-button svg {
    width: 23px;
    height: 23px;
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card {
    border-color: rgba(167, 139, 250, 0.24);
    background: rgba(22, 27, 34, 0.95);
    box-shadow: 0 24px 58px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-card-header {
    background:
        linear-gradient(120deg, rgba(139, 92, 246, 0.2), rgba(22, 27, 34, 0.82) 56%, rgba(22, 27, 34, 0.96)),
        #161b22;
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-card-title-copy h3,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-card-body::before,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card .form-item label,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-card-guide-panel strong {
    color: var(--text-primary-dark);
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-card-guide-panel,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card .form-item-panel {
    background: rgba(13, 17, 23, 0.54);
    border-color: rgba(139, 148, 158, 0.22);
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-card-description,
html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-card-guide-panel p {
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-free-badge {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card .weibo-backup-option .weibo-backup-hint {
    color: var(--text-secondary-dark);
}

html[data-theme="dark"] #configModule .config-back-button {
    border-color: rgba(139, 148, 158, 0.24);
    background: rgba(13, 17, 23, 0.64);
    color: var(--text-primary-dark);
}

@media (min-width: 900px) {
    #configModule.card {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        transform: none;
    }

    #configOptionsContainer > .config-sub-card .config-card-header {
        min-height: 148px;
    }

    #configOptionsContainer > .config-sub-card .config-card-body {
        padding: 28px 36px 34px;
    }

    #configOptionsContainer > .config-sub-card .form-item-panel {
        grid-template-columns: minmax(190px, 0.45fr) minmax(0, 1fr);
    }

    #configModule .config-wizard-actions {
        max-width: 650px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    #configOptionsContainer > .config-sub-card {
        border-radius: 20px;
    }

    #configOptionsContainer > .config-sub-card .config-card-header {
        min-height: 118px;
        padding: 22px 24px 18px;
    }

    #configOptionsContainer > .config-sub-card .config-card-title-group {
        gap: 16px;
    }

    #configOptionsContainer > .config-sub-card .config-card-step-badge {
        width: 64px;
        height: 64px;
        flex-basis: 64px;
    }

    #configOptionsContainer > .config-sub-card .config-card-step-badge svg {
        width: 32px;
        height: 32px;
    }

    #configOptionsContainer > .config-sub-card .config-card-title-copy h3 {
        font-size: 23px;
    }

    #configOptionsContainer > .config-sub-card .config-card-description {
        font-size: 15px;
    }

    #configOptionsContainer > .config-sub-card .config-card-body {
        padding: 24px;
    }

    #configOptionsContainer > .config-sub-card .form-item-panel {
        min-height: 74px;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #configOptionsContainer > .config-sub-card .form-item-hint {
        text-align: left;
    }
}

@media (max-width: 480px) {
    #configOptionsContainer > .config-sub-card {
        border-radius: 18px;
    }

    #configOptionsContainer > .config-sub-card .config-card-header {
        padding: 20px 18px 17px;
    }

    #configOptionsContainer > .config-sub-card .config-card-title-group {
        gap: 14px;
    }

    #configOptionsContainer > .config-sub-card .config-card-step-badge {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
    }

    #configOptionsContainer > .config-sub-card .config-card-title-copy h3 {
        font-size: 21px;
    }

    #configOptionsContainer > .config-sub-card .config-card-body {
        padding: 22px 18px 20px;
    }

    #configOptionsContainer > .config-sub-card .config-card-body::before {
        margin-bottom: 15px;
        font-size: 17px;
    }

    #configOptionsContainer > .config-sub-card .config-card-guide-panel {
        align-items: flex-start;
        padding: 16px;
    }

    #configModule #saveConfigButton {
        min-height: 60px;
        font-size: 18px;
    }

    #configModule .config-back-button {
        min-height: 56px;
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .config-progress-dot,
    #configOptionsContainer > .config-sub-card .config-step-toggle svg {
        transition: none;
    }
}

/* Horizontal wizard interaction: one full card per viewport, swipe or drag to move. */
#configOptionsContainer {
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: hidden;
    scroll-snap-type: none;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: auto;
    touch-action: pan-y;
    cursor: grab;
    transition: height var(--transition-smooth);
}

#configOptionsContainer::-webkit-scrollbar {
    display: none;
}

#configOptionsContainer.is-dragging {
    cursor: grabbing;
    user-select: none;
}

#configOptionsContainer > .config-sub-card,
#configOptionsContainer > .config-sub-card.config-step-hidden {
    display: block !important;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    transform: translate3d(0, 0, 0);
    transition: transform var(--transition-smooth);
    will-change: transform;
}

#configOptionsContainer.is-dragging > .config-sub-card,
#configOptionsContainer.is-positioning > .config-sub-card {
    transition: none !important;
}

#configOptionsContainer > .config-sub-card.config-step-inactive {
    pointer-events: auto;
}

#configModule .config-wizard-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
    gap: 12px;
    margin: 0;
}

#configModule #saveConfigButton,
#configModule .config-back-button {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 0 16px;
    white-space: nowrap;
    font-size: 18px;
}

#configModule #saveConfigButton::before,
#configModule #saveConfigButton:disabled::before {
    content: none;
}

#configModule .config-back-button:disabled {
    cursor: not-allowed;
    opacity: 0.46;
    color: #8f98aa;
    background: rgba(255, 255, 255, 0.62);
    transform: none;
    box-shadow: none;
}

#configModule .config-back-button:disabled:hover {
    border-color: rgba(148, 163, 184, 0.18);
    color: #8f98aa;
    background: rgba(255, 255, 255, 0.62);
    transform: none;
}

html[data-theme="dark"] #configModule .config-back-button:disabled,
html[data-theme="dark"] #configModule .config-back-button:disabled:hover {
    color: var(--disabled-text-dark);
    background: rgba(13, 17, 23, 0.38);
}

@media (max-width: 480px) {
    #configModule .config-wizard-actions {
        grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
        gap: 10px;
    }

    #configModule #saveConfigButton,
    #configModule .config-back-button {
        min-height: 54px;
        padding: 0 12px;
        font-size: 16px;
    }

    #configModule .config-back-button svg {
        width: 19px;
        height: 19px;
    }
}

/* Compact wizard refinements. */
#configOptionsContainer > .config-sub-card .config-card-header {
    min-height: 104px;
    padding: 18px 24px 16px;
}

#configOptionsContainer > .config-sub-card .config-card-title-group {
    gap: 14px;
    align-items: flex-start;
}

#configOptionsContainer > .config-sub-card .config-card-step-badge {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    align-self: flex-start;
    box-shadow: 0 12px 24px rgba(124, 58, 237, 0.22);
}

#configOptionsContainer > .config-sub-card .config-card-step-badge svg {
    width: 16px;
    height: 16px;
}

#configOptionsContainer > .config-sub-card .config-card-step-label {
    margin-bottom: 3px;
    font-size: 12px;
}

#configOptionsContainer > .config-sub-card .config-card-title-copy h3 {
    font-size: 22px;
}

#configOptionsContainer > .config-sub-card .config-card-description {
    margin-top: 5px;
    font-size: 14px;
    line-height: 1.38;
}

#configOptionsContainer > .config-sub-card .config-step-toggle {
    width: 32px;
    min-width: 32px;
    height: 32px;
}

#configOptionsContainer > .config-sub-card .config-card-header {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-step-toggle {
    border: 1px solid rgba(167, 139, 250, 0.36);
    background: rgba(167, 139, 250, 0.16);
    color: #d8ccff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card .config-step-toggle:hover {
    border-color: rgba(196, 181, 253, 0.52);
    background: rgba(167, 139, 250, 0.24);
    color: #ffffff;
}

#configOptionsContainer > .config-sub-card .config-card-guide-panel {
    gap: 9px;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 12px;
}

#configOptionsContainer > .config-sub-card .config-card-guide-icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
}

#configOptionsContainer > .config-sub-card .config-card-guide-panel strong {
    font-size: 14px;
    line-height: 1.25;
}

#configOptionsContainer > .config-sub-card .config-card-guide-panel p {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.35;
}

#configModule .config-wizard-actions {
    grid-template-columns: minmax(0, 0.45fr) minmax(0, 0.55fr);
    max-width: 430px;
    gap: 10px;
    margin: 0 auto;
}

#configModule #saveConfigButton,
#configModule .config-back-button {
    min-height: 44px;
    padding: 0 14px;
    font-size: 15px;
}

#configModule .config-back-button {
    gap: 7px;
}

#configModule .config-back-button svg {
    width: 18px;
    height: 18px;
}

@media (min-width: 900px) {
    #configOptionsContainer > .config-sub-card .config-card-header {
        width: 100%;
        min-height: 112px;
        margin: 0;
        padding: 20px 28px 18px;
        border-radius: 0;
    }

    #configModule .config-wizard-actions {
        max-width: 460px;
    }
}

@media (max-width: 768px) {
    #configOptionsContainer > .config-sub-card .config-card-header {
        min-height: 98px;
        padding: 17px 18px 15px;
    }

    #configOptionsContainer > .config-sub-card .config-card-step-badge {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    #configOptionsContainer > .config-sub-card .config-card-step-badge svg {
        width: 16px;
        height: 16px;
    }

    #configOptionsContainer > .config-sub-card .config-card-title-copy h3 {
        font-size: 20px;
    }

    #configOptionsContainer > .config-sub-card .config-card-description {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    #configOptionsContainer > .config-sub-card .config-card-header {
        min-height: 92px;
        padding: 16px 16px 14px;
    }

    #configOptionsContainer > .config-sub-card .config-card-title-group {
        gap: 11px;
    }

    #configOptionsContainer > .config-sub-card .config-card-step-badge {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    #configOptionsContainer > .config-sub-card .config-card-title-copy h3 {
        font-size: 19px;
    }

    #configOptionsContainer > .config-sub-card .config-card-guide-panel {
        padding: 9px 10px;
    }

    #configModule .config-wizard-actions {
        max-width: 330px;
        grid-template-columns: minmax(0, 0.45fr) minmax(0, 0.55fr);
        gap: 8px;
    }

    #configModule #saveConfigButton,
    #configModule .config-back-button {
        min-height: 42px;
        padding: 0 10px;
        font-size: 14px;
    }
}

/* The horizontal scroll container clips outer shadows; keep the card edge clean. */
#configOptionsContainer > .config-sub-card {
    box-shadow: none;
    border-color: rgba(139, 92, 246, 0.18);
}

html[data-theme="dark"] #configOptionsContainer > .config-sub-card {
    box-shadow: none;
}

#configOptionsContainer,
#configOptionsContainer > .config-sub-card,
#configOptionsContainer > .config-sub-card .config-card-header {
    min-width: 0;
}

#configOptionsContainer > .config-sub-card {
    overflow: hidden;
}

.service-agreement-row {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 22px 14px;
    padding: 11px 13px;
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
}

.service-agreement-row input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: #7d4cff;
}

.service-agreement-row a {
    color: #6d40e8;
    font-weight: 800;
    text-decoration: none;
}

.service-agreement-row a:hover {
    text-decoration: underline;
}

.service-agreement-row.is-locked {
    opacity: 0.78;
    cursor: not-allowed;
}

.service-agreement-row.is-locked input {
    cursor: not-allowed;
}

html[data-theme="dark"] .service-agreement-row {
    border-color: rgba(167, 139, 250, 0.24);
    background: rgba(13, 17, 23, 0.64);
    color: rgba(228, 234, 246, 0.76);
}

html[data-theme="dark"] .service-agreement-row a {
    color: #c4b5fd;
}

.policy-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(139, 92, 246, 0.14), transparent 32%),
        linear-gradient(180deg, #f7f8fc 0%, #eef2f8 100%);
    color: #1f2937;
}

.policy-shell {
    width: min(960px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.policy-hero {
    margin-bottom: 22px;
    padding: 30px;
    border: 1px solid rgba(139, 92, 246, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 20px 52px rgba(31, 41, 55, 0.08);
}

.policy-back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 18px;
    color: #6d40e8;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.policy-back-link:hover {
    text-decoration: underline;
}

.policy-kicker,
.policy-updated {
    margin: 0;
    color: #7c3aed;
    font-size: 13px;
    font-weight: 800;
}

.policy-hero h1 {
    margin: 8px 0 14px;
    color: #111827;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.12;
}

.policy-hero p {
    max-width: 780px;
    margin: 0 0 10px;
    color: #4b5563;
    font-size: 16px;
    line-height: 1.75;
}

.policy-section {
    margin-top: 16px;
    padding: 24px 28px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 32px rgba(31, 41, 55, 0.05);
}

.policy-section h2 {
    margin: 0 0 13px;
    color: #111827;
    font-size: 20px;
    line-height: 1.35;
}

.policy-section p,
.policy-section li {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.85;
}

.policy-section p {
    margin: 0 0 12px;
}

.policy-section p:last-child {
    margin-bottom: 0;
}

.policy-section ul {
    margin: 0 0 12px;
    padding-left: 20px;
}

.policy-section li + li {
    margin-top: 8px;
}

@media (max-width: 640px) {
    .service-agreement-row {
        margin: 0 14px 12px;
        border-radius: 10px;
        font-size: 12px;
    }

    .policy-shell {
        width: min(100% - 22px, 960px);
        padding: 22px 0 44px;
    }

    .policy-hero,
    .policy-section {
        padding: 20px;
        border-radius: 14px;
    }

    .policy-hero h1 {
        font-size: 30px;
    }

    .policy-hero p,
    .policy-section p,
    .policy-section li {
        font-size: 14px;
    }
}
