html {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

/* 页面跳转加载指示器样式 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid color-mix(in srgb, var(--accent) 20%, transparent);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

body {
    background-color: var(--page-bg);
    color: var(--fg);
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    /* No overflow-x here: it would make body a sticky-container and stop the
       sticky header from pinning. Horizontal overflow is still clipped by
       html { overflow-x: hidden }. */
    box-sizing: border-box;
}

/* Skip link: visually hidden until keyboard focus, then above sticky header. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 10000;
    padding: 0.75rem 1.25rem;
    background: var(--phosphor, #3DDC84);
    color: var(--ink-deeper, #04120A);
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 6px 6px;
}
.skip-link:focus,
.skip-link:focus-visible {
    left: 12px;
    top: 12px;
    width: auto;
    height: auto;
    overflow: visible;
    outline: 3px solid var(--ink, #0A1410);
    outline-offset: 2px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
a {
    text-decoration:none;
    transition: color 0.3s ease;
}

/* The site never set a link colour, so any hand-written prose link fell back
   to the browser's #0000EE — fine on white, unreadable on the dark themes.
   Scoped to unclassed links so every button-shaped <a> keeps its own colour. */
a:not([class]) {
    color: var(--link);
}
a:not([class]):hover {
    color: var(--accent-text);
    text-decoration: underline;
}

/* Sticky header: stays at the top on scroll but reserves its own space in flow,
   so content is never hidden behind it regardless of the (wrapping) nav height. */
header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--header-bg);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    box-shadow: none;
    border-bottom: 1px solid var(--line);
    padding: 10px clamp(16px, 3vw, 30px) 8px;
    border-radius: 0;
}
/* Scoped to the main menu: a bare `nav` here used to paint every other <nav>
   (pager, breadcrumbs, article Prev/Next, project tabs) like the header. */
header > nav {
    background-color: var(--nav-bg);
    padding: 8px 0 2px;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 4px;
    border-top: 1px solid var(--line);
}
.nav-bar {
    color: var(--nav-fg);
    padding: 7px 13px;
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    font-weight: 500;
    font-size: 14.5px;
    border-radius: 8px;
    transition: color .18s ease, background .18s ease;
}
.nav-bar:hover {
    color: var(--accent-hover);
    background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.dev-link {
    color: #ff6b6b !important;
    font-weight: bold;
}

.dev-link:hover {
    color: #ff5252 !important;
}
.logo-text {
    padding-left: 30px;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--header-fg);
    margin: 4px 0;
    font-size: clamp(20px, 3vw, 26px);
    position: relative;
    display: inline-block;
    line-height: 1.1;
}
.logo-text::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: linear-gradient(150deg, #3DDC84, var(--accent));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.loginButton {
    /* sits on the themed header, so it cannot keep a literal black */
    color: var(--fg);
    padding: 0 25px;
    font-weight: bold;
}
.loginButton:hover {
    color: var(--accent-text);
}
.page-content {
    background-color: var(--content-bg);
    padding: 20px;
    margin: 20px;
    border-radius: 10px;
}
.team-members {
    display: flex;
    flex-direction: column;
    align-items: center;
}
footer {
    background-color: var(--footer-bg);
    text-align: center;
    padding: 16px 10px;
    width: 100%;
    /* with padding and no border-box this is 20px wider than the
       viewport, so every page on the site scrolls sideways a little. */
    box-sizing: border-box;
    color: var(--footer-fg);
    font-weight: 500;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 13px;
    letter-spacing: 0.02em;
    border-top: 1px solid #21382E;
    z-index: 999;
}
/* Keyboard-shortcuts help: footer trigger + small modal (base.html). */
.kbd-help-btn {
    background: none;
    border: none;
    padding: 0;
    margin-left: 12px;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.kbd-help-btn:focus-visible,
.kbd-help-close:focus-visible,
.kbd-help:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.kbd-help-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
}
.kbd-help-backdrop[hidden] { display: none; }
.kbd-help {
    width: 100%;
    max-width: 420px;
    padding: 20px 24px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--fg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.kbd-help-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.kbd-help-head h2 { margin: 0; font-size: 1.2rem; }
.kbd-help-close {
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    font-size: 26px;
    color: var(--fg-faint);
    cursor: pointer;
}
.kbd-help-close:hover { color: var(--accent-text); }
.kbd-help-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 16px;
    margin: 0;
    align-items: center;
}
.kbd-help-list dd { margin: 0; }
.kbd-help-list kbd {
    display: inline-block;
    min-width: 1.6em;
    padding: 2px 6px;
    border: 1px solid var(--fg-faint);
    border-radius: 4px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.9em;
    text-align: center;
}
.contact-button {
    display: inline-block;
    margin: 5px;
    padding: 10px 15px;
    background-color: var(--accent);
    color: var(--accent-fg);
    border-radius: 5px;
    font-weight: bold;
}
.contact-button:hover {
    background-color: var(--accent-hover);
    color: var(--accent-fg);
}

/* 认证表单样式 */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 16px;
    background: var(--input-bg);
    color: var(--fg);
    box-sizing: border-box;
}

.auth-button {
    width: 100%;
    padding: 12px;
    background-color: var(--accent);
    color: var(--accent-fg);
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.auth-button:hover {
    background-color: var(--accent-hover);
    color: var(--accent-fg);
}

.auth-link {
    text-align: center;
    margin-top: 15px;
}

.auth-link a {
    color: var(--accent-text);
    font-weight: bold;
}

.auth-link a:hover {
    color: var(--accent-hover);
}

/* 社交登录 (Social auth — Continue with Google / GitHub) */
.social-auth {
    margin-top: 8px;
}

.social-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--fg-5);
    font-size: 13px;
    margin: 18px 0 14px;
}

.social-divider::before,
.social-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    margin-bottom: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 14px;
    color: var(--fg-2);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-social:hover {
    color: var(--fg-2);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

.btn-social svg {
    flex: 0 0 auto;
}

/* 消息提示样式 */
.flash-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    font-weight: bold;
}

.flash-message.success {
    background-color: var(--success-bg);
    color: var(--success-fg);
    border: 1px solid var(--success-line);
}

.flash-message.error {
    background-color: var(--danger-bg);
    color: var(--danger-fg);
    border: 1px solid var(--danger-line);
}

.flash-message.info {
    background-color: var(--info-bg);
    color: var(--info-fg);
    border: 1px solid var(--info-line);
}

/* Alert Messages Styles */
.alert-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    min-width: 300px;
    max-width: 500px;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideInRight 0.5s ease-out;
    margin-right: 0;
    box-sizing: border-box;
}

.alert-message:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.alert-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    position: relative;
}

.alert-icon {
    font-weight: bold;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alert-text {
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
}

.alert-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 20px;
    font-weight: bold;
    color: rgba(0,0,0,0.5);
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    /* Real <button>: kill UA chrome so it still looks like the old × */
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    font-family: inherit;
}

.alert-close:hover {
    color: rgba(0,0,0,0.8);
}

/* Alert Types */
.alert-success {
    background: linear-gradient(135deg, var(--success-bg), var(--success-line));
    border-left: 4px solid var(--success);
    color: var(--success-fg);
}

.alert-success .alert-icon {
    background-color: var(--success);
    color: var(--on-success);
}

.alert-error {
    background: linear-gradient(135deg, var(--danger-bg), var(--danger-line));
    border-left: 4px solid var(--danger);
    color: var(--danger-fg);
}

.alert-error .alert-icon {
    background-color: var(--danger);
    color: var(--on-danger);
}

.alert-warning {
    background: linear-gradient(135deg, var(--warning-bg), var(--warning-line));
    border-left: 4px solid var(--warning);
    color: var(--warning-fg);
}

.alert-warning .alert-icon {
    background-color: var(--warning);
    color: var(--fg-2);
}

.alert-info {
    background: linear-gradient(135deg, var(--info-bg), var(--info-line));
    border-left: 4px solid var(--info);
    color: var(--info-fg);
}

.alert-info .alert-icon {
    background-color: var(--info);
    color: var(--on-info);
}

/* Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design for Alerts */
@media (max-width: 768px) {
    .alert-message {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .alert-content {
        padding: 12px 16px;
    }
    
    .alert-icon {
        font-size: 10px;
        padding: 3px 6px;
        margin-right: 8px;
    }
    
    .alert-close {
        top: 6px;
        right: 8px;
        font-size: 18px;
    }
}

/* 用户资料样式 */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--surface-2);
    border-radius: 10px;
}

.avatar-section {
    margin-right: 30px;
    text-align: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent);
    margin-bottom: 10px;
}

.avatar-form {
    margin-top: 10px;
}

.avatar-label {
    display: none;
}

.avatar-input {
    margin-bottom: 10px;
    font-size: 14px;
}

.avatar-button {
    padding: 8px 16px;
    background-color: var(--accent);
    color: var(--accent-fg);
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.avatar-button:hover {
    background-color: var(--accent-hover);
    color: white;
}

.profile-info h2 {
    margin: 0 0 5px 0;
    color: var(--fg-2);
}

.username {
    color: var(--fg-muted);
    font-style: italic;
    margin: 0 0 10px 0;
}

.bio {
    color: var(--fg-3);
    line-height: 1.5;
    margin: 10px 0;
}

.join-date {
    color: var(--fg-5);
    font-size: 14px;
    margin: 10px 0 0 0;
}

.profile-actions {
    text-align: center;
    margin-top: 20px;
}

.edit-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--accent);
    color: var(--accent-fg);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.edit-button:hover {
    background-color: var(--accent-hover);
    color: var(--accent-fg);
}

/* 资料编辑表单样式 */
.profile-form {
    max-width: 600px;
    margin: 0 auto;
}

.profile-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 16px;
    font-family: Arial, Helvetica, sans-serif;
    resize: vertical;
    background: var(--input-bg);
    color: var(--fg);
    box-sizing: border-box;
}

.save-button {
    padding: 12px 24px;
    background-color: var(--accent);
    color: var(--accent-fg);
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.save-button:hover {
    background-color: var(--accent-hover);
    color: var(--accent-fg);
}

.cancel-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--neutral-btn);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.cancel-button:hover {
    background-color: var(--neutral-btn-hover);
    color: white;
}

/* 聊天页面样式 */
.chat-subtitle {
    text-align: center;
    color: var(--fg-muted);
    font-style: italic;
    margin-bottom: 20px;
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--surface-2);
    border-radius: 10px;
    overflow: hidden;
}

.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--line);
}

.message {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-start;
}

.message-avatar {
    margin-right: 10px;
}

.message-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.message-content {
    flex: 1;
    background-color: var(--content-bg);
    padding: 10px 15px;
    border-radius: 10px;
    border-top-left-radius: 5px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.message-username {
    font-weight: bold;
    color: var(--accent-text);
    font-size: 14px;
}

.message-time {
    font-size: 12px;
    color: var(--fg-5);
}

.message-text {
    color: var(--fg-2);
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-form {
    padding: 20px;
    background-color: var(--surface-2);
}

.message-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.message-input-container textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    resize: vertical;
    min-height: 40px;
    max-height: 100px;
}

.send-button {
    padding: 10px 20px;
    background-color: var(--accent);
    color: var(--accent-fg);
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.send-button:hover {
    background-color: var(--accent-hover);
    color: white;
}

.login-prompt {
    text-align: center;
    padding: 40px;
    background-color: var(--surface-2);
    border-radius: 10px;
    margin: 20px 0;
}

.login-prompt h2 {
    color: var(--fg-2);
    margin-bottom: 10px;
}

.login-prompt p {
    color: var(--fg-muted);
    margin-bottom: 20px;
}

.login-link, .register-link {
    display: inline-block;
    margin: 0 10px;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.login-link {
    background-color: var(--accent);
    color: var(--accent-fg);
}

.login-link:hover {
    background-color: var(--accent-hover);
    color: white;
}

.register-link {
    background-color: var(--neutral-btn);
    color: white;
}

.register-link:hover {
    background-color: var(--neutral-btn-hover);
    color: white;
}

/* 应用相关样式 */
.app-actions {
    margin: 20px 0;
    text-align: center;
}

.upload-button, .my-apps-button, .view-all-button {
    display: inline-block;
    margin: 5px 10px;
    padding: 12px 24px;
    background-color: var(--accent);
    color: var(--accent-fg);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.upload-button:hover, .my-apps-button:hover, .view-all-button:hover {
    background-color: var(--accent-hover);
    color: white;
}

/* 法律免责声明样式 */
.legal-disclaimer {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning-line);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.legal-disclaimer h3 {
    color: var(--warning-fg);
    margin-top: 0;
}

.disclaimer-content {
    color: var(--warning-fg);
}

.disclaimer-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.disclaimer-content li {
    margin: 5px 0;
    line-height: 1.4;
}

/* 应用网格布局 */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.app-card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.app-header h3 {
    margin: 0;
    color: var(--fg-2);
    font-size: 18px;
}

.app-version {
    background-color: var(--accent);
    color: var(--accent-fg);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.app-category {
    margin-bottom: 10px;
}

.category-tag {
    background-color: var(--surface-2);
    color: var(--fg-muted);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid var(--line);
}

.app-description {
    margin: 15px 0;
    color: var(--fg-muted);
    line-height: 1.5;
}

.app-details {
    margin: 15px 0;
    font-size: 14px;
    color: var(--fg-3);
}

.app-details p {
    margin: 5px 0;
}

.app-screenshot {
    margin: 15px 0;
    text-align: center;
}

.screenshot-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 5px;
    border: 1px solid var(--line);
}

.app-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.download-button, .contact-button {
    flex: 1;
    padding: 10px;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.download-button {
    background-color: var(--accent);
    color: var(--accent-fg);
}

.download-button:hover {
    background-color: var(--accent-hover);
    color: white;
}

.contact-button {
    background-color: var(--neutral-btn);
    color: white;
}

.contact-button:hover {
    background-color: var(--neutral-btn-hover);
}

.no-apps {
    text-align: center;
    padding: 40px;
    background-color: var(--surface-2);
    border-radius: 10px;
    margin: 20px 0;
}

.no-apps p {
    color: var(--fg-muted);
    margin-bottom: 20px;
}

/* 应用表单样式 */
.app-form {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--surface);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--fg-2);
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 16px;
    font-family: Arial, Helvetica, sans-serif;
    /* Without these a field keeps the browser's white-on-black default, so
       every form on the site stayed light while the page around it went dark. */
    background: var(--input-bg);
    color: var(--fg);
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--fg-muted);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.submit-button, .save-button {
    padding: 15px 30px;
    background-color: var(--accent);
    color: var(--accent-fg);
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover, .save-button:hover {
    background-color: var(--accent-hover);
    color: white;
}

/* 我的应用列表样式 */
.my-apps-actions {
    text-align: center;
    margin: 20px 0;
}

.my-apps-list {
    margin: 20px 0;
}

.my-app-card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-status {
    margin-bottom: 10px;
}

.status-approved {
    color: var(--success);
    font-weight: bold;
}

.status-pending {
    color: var(--warning);
    font-weight: bold;
}

.app-info {
    flex: 1;
    margin-right: 20px;
}

.app-info h3 {
    margin: 0 0 5px 0;
    color: var(--fg-2);
}

.app-info p {
    margin: 3px 0;
    color: var(--fg-muted);
    font-size: 14px;
}

.app-os, .app-file-type {
    color: var(--accent-text);
    font-weight: bold;
}

.my-app-card .app-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.edit-button, .delete-button {
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.edit-button {
    background-color: var(--accent);
    color: var(--accent-fg);
}

.edit-button:hover {
    background-color: var(--accent-hover);
    color: white;
}

.delete-button {
    background-color: var(--danger);
    color: var(--on-danger);
}

.delete-button:hover {
    background-color: var(--danger-hover);
}

.delete-form {
    display: inline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .apps-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .my-app-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .app-info {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .my-app-card .app-actions {
        flex-direction: row;
        width: 100%;
    }
    
    .edit-button, .delete-button {
        flex: 1;
    }
}

/* File upload styles */
.form-group input[type="file"] {
    padding: 8px;
    background-color: var(--surface-2);
    border: 2px dashed var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group input[type="file"]:hover {
    background-color: var(--bg-cool);
    border-color: var(--accent-hover);
}

.form-group input[type="file"]:focus {
    outline: none;
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.app-file, .app-url {
    color: var(--accent-text);
    font-weight: bold;
    font-size: 13px;
}

/* Developer management styles */
.dev-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--accent);
}

.dev-header h1 {
    margin: 0;
    color: var(--fg-2);
}

.dev-header p {
    margin: 5px 0;
    color: var(--fg-muted);
}

.logout-link, .back-link {
    color: var(--accent-text);
    text-decoration: none;
    font-weight: bold;
    padding: 8px 16px;
    border: 1px solid var(--accent);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.logout-link:hover, .back-link:hover {
    background-color: var(--accent);
    color: var(--accent-fg);
}

.dev-info {
    background-color: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.dev-info h3 {
    color: var(--fg-2);
    margin-top: 0;
}

.dev-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.dev-info li {
    margin: 5px 0;
    color: var(--fg-muted);
}

/* Statistics grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card h3 {
    /* Most of these are a number, but a few are a label ("Storage
       Management"), which at 2.5em ran straight out of the card. */
    font-size: clamp(1.25rem, 2.2vw + .6rem, 2.5em);
    line-height: 1.15;
    margin: 0 0 10px 0;
    color: var(--accent-text);
    overflow-wrap: anywhere;
}

.stat-card p {
    margin: 0 0 15px 0;
    color: var(--fg-muted);
    font-weight: bold;
}

.stat-link {
    color: var(--accent-text);
    text-decoration: none;
    font-weight: bold;
    padding: 8px 16px;
    border: 1px solid var(--accent);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.stat-link:hover {
    background-color: var(--accent);
    color: var(--accent-fg);
}

.stat-card.pending h3 {
    color: var(--warning);
}

.stat-card.approved h3 {
    color: var(--success);
}

/* Quick actions */
.quick-actions {
    margin: 30px 0;
    padding: 20px;
    background-color: var(--surface-2);
    border-radius: 10px;
}

.quick-actions h2 {
    margin-top: 0;
    color: var(--fg-2);
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-button {
    padding: 12px 24px;
    background-color: var(--accent);
    color: var(--accent-fg);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.action-button:hover {
    background-color: var(--accent-hover);
}

/* Recent activity */
.recent-activity {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.recent-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
}

.recent-section h2 {
    margin-top: 0;
    color: var(--fg-2);
    border-bottom: 1px solid var(--border-3);
    padding-bottom: 10px;
}

.recent-list {
    max-height: 400px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--content-bg);
}

.recent-item:last-child {
    border-bottom: none;
}

.item-info h4 {
    margin: 0 0 5px 0;
    color: var(--fg-2);
}

.item-info p {
    margin: 0 0 5px 0;
    color: var(--fg-muted);
    font-size: 14px;
}

.status-badge, .user-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.status-badge.approved {
    background-color: var(--success-bg);
    color: var(--success-fg);
}

.status-badge.pending {
    background-color: var(--warning-bg);
    color: var(--warning-fg);
}

.user-badge {
    background-color: var(--surface-2);
    color: var(--fg-muted);
    border: 1px solid var(--line);
}

.item-actions {
    display: flex;
    gap: 10px;
}

.approve-btn, .reject-btn, .delete-btn, .download-btn, .revoke-btn {
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.approve-btn {
    background-color: var(--success);
    color: var(--on-success);
}

.approve-btn:hover {
    background-color: #218838;
}

.reject-btn, .delete-btn {
    background-color: var(--danger);
    color: var(--on-danger);
}

.reject-btn:hover, .delete-btn:hover {
    background-color: var(--danger-hover);
}

.download-btn {
    background-color: #007bff;
    color: white;
}

.download-btn:hover {
    background-color: #0056b3;
}

.revoke-btn {
    background-color: var(--warning);
    color: var(--on-warning);
}

.revoke-btn:hover {
    background-color: #e0a800;
}

/* Search functionality */
.search-section {
    background-color: var(--surface-2);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid var(--bg-cool);
}

.search-form {
    margin-bottom: 15px;
}

.search-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--line);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

.search-button {
    padding: 12px 20px;
    background-color: var(--accent);
    color: var(--accent-fg);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #00a800;
}

.filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.category-filter {
    padding: 10px 12px;
    border: 2px solid var(--line);
    border-radius: 6px;
    font-size: 14px;
    background-color: var(--surface);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.category-filter:focus {
    outline: none;
    border-color: var(--accent);
}

.clear-filters {
    padding: 8px 16px;
    background-color: var(--neutral-btn);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.clear-filters:hover {
    background-color: var(--neutral-btn-hover);
    color: white;
}

.search-results-info {
    background-color: #e3f2fd;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid #2196f3;
}

.search-results-info p {
    margin: 0;
    color: #1976d2;
    font-weight: 500;
}

/* 邮箱验证码样式 */
.verification-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.verification-group input {
    flex: 1;
}

.send-code-btn {
    padding: 8px 16px;
    background-color: var(--accent);
    color: var(--accent-fg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.send-code-btn:hover:not(:disabled) {
    background-color: #00a800;
}

.send-code-btn:disabled {
    background-color: var(--line);
    cursor: not-allowed;
}

.form-help {
    color: var(--fg-muted);
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* 响应式设计 - 移动设备 */
@media (max-width: 768px) {
    .verification-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .send-code-btn {
        width: 100%;
    }
}

/* Apps management */
.apps-management, .users-management {
    margin: 20px 0;
}

.app-management-card, .user-management-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.app-header, .user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.app-header h3, .user-header h3 {
    margin: 0;
    color: var(--fg-2);
}

.version-badge {
    background-color: var(--accent);
    color: var(--accent-fg);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.app-details, .user-details {
    margin: 15px 0;
}

.detail-row {
    margin: 8px 0;
    color: var(--fg-muted);
}

.user-avatar {
    margin-right: 15px;
}

.avatar-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.user-stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    background-color: var(--surface-2);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--fg-muted);
}

.user-apps-list {
    margin: 5px 0;
    padding-left: 20px;
}

.user-apps-list li {
    margin: 3px 0;
    font-size: 14px;
}

.app-actions, .user-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-3);
}

.approved-text {
    color: var(--success);
    font-weight: bold;
}

.no-apps, .no-users {
    text-align: center;
    padding: 40px;
    background-color: var(--surface-2);
    border-radius: 10px;
    color: var(--fg-muted);
}

/* Responsive design */
@media (max-width: 768px) {
    .recent-activity {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .dev-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .app-header, .user-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .item-actions {
        margin-top: 10px;
    }
}

/* 语言选择器样式 */
.language-selector {
    display: inline-block;
    margin-left: 20px;
}

.language-dropdown {
    background-color: var(--surface);
    border: 2px solid var(--accent);
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    color: var(--fg-2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-dropdown:hover {
    background-color: var(--accent);
    color: var(--accent-fg);
}

.language-dropdown:focus {
    outline: none;
    box-shadow: 0 0 5px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* 移动端语言选择器样式 */
@media (max-width: 768px) {
    .language-selector {
        margin-left: 0;
        margin-top: 10px;
        display: block;
        text-align: center;
    }
    
    .language-dropdown {
        width: 150px;
    }
}

/* ===== 文章页面样式 ===== */

/* 文章列表页面 */
.articles-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.articles-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--accent);
}

.articles-page-header h1 {
    color: var(--fg-2);
    margin: 0;
    font-weight: bold;
}

.articles-search-filter-section {
    background-color: var(--surface-2);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid var(--bg-cool);
}

.articles-search-form {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.articles-search-input-group {
    flex: 1;
    min-width: 300px;
}

.articles-search-input {
    width: 100%;
    padding: 12px 16px;
    margin: 0 10px 10px 0;
    border: 2px solid var(--line);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.articles-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

.articles-filter-group {
    display: flex;
    gap: 10px;
}

.articles-category-filter {
    padding: 10px 12px;
    border: 2px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.articles-category-filter:focus {
    outline: none;
    border-color: var(--accent);
}

.articles-search-btn, .articles-filter-btn {
    padding: 12px 20px;
    background-color: var(--accent);
    color: var(--accent-fg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.articles-search-btn:hover, .articles-filter-btn:hover {
    background-color: #00a800;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.article-card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-color: var(--accent);
}

.article-card-header {
    margin-bottom: 15px;
}

.article-card-title {
    color: var(--fg-2);
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.article-card-meta {
    margin-top: 8px;
    font-size: 14px;
    color: var(--fg-muted);
}

.article-card-meta span {
    margin-right: 15px;
}

.article-card-content {
    margin-bottom: 15px;
}

.article-card-summary {
    color: var(--fg-3);
    line-height: 1.6;
    margin-bottom: 10px;
}

.article-card-tags {
    margin-top: 10px;
}

.article-tag {
    display: inline-block;
    background-color: var(--surface-2);
    color: var(--neutral-btn);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
    border: 1px solid var(--line);
}

.article-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--content-bg);
}

.article-card-stats {
    font-size: 14px;
    color: var(--fg-muted);
}

.article-card-stats span {
    margin-right: 15px;
}

.article-category-badge {
    background-color: var(--accent);
    color: var(--accent-fg);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.articles-no-results {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--surface-2);
    border-radius: 10px;
    color: var(--fg-muted);
}

.articles-no-results h3 {
    margin-bottom: 15px;
    color: var(--fg-2);
}

/* 文章详情页面 */
.article-detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 返回按钮样式 */
.article-back-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--surface-2);
    border: 2px solid var(--neutral-btn);
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    color: var(--fg-2);
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: Arial, Helvetica, sans-serif;
}

.btn-back:hover {
    background-color: var(--neutral-btn);
    color: white;
    transform: translateX(-3px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.back-icon {
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.back-text {
    font-weight: bold;
}

.article-detail {
    background-color: var(--surface);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid var(--line);
}

.article-detail-header {
    margin-bottom: 30px;
    padding-left: 30px;
    padding-right: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--accent);
}

.article-detail-title {
    color: var(--fg-2);
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.article-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.article-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.article-author-details {
    display: flex;
    flex-direction: column;
}

.article-author-name {
    font-weight: bold;
    color: var(--fg-2);
}

.article-publish-date {
    color: var(--fg-muted);
    font-size: 14px;
}

.article-detail-stats {
    display: flex;
    gap: 20px;
}

.article-stat-item {
    color: var(--fg-muted);
    font-size: 14px;
}

.article-stat-icon {
    margin-right: 5px;
}

.article-tags-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.article-detail-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--fg-2);
    margin-bottom: 30px;
}

/* 点赞按钮样式 */
.article-like-section {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: center;
}

/* Previous / Next article. Two cards side by side; either may be absent, so
   the "next" one is pushed to the right edge whether or not a "previous" one
   sits beside it. On a narrow screen they stack. */
.article-nav {
    display: flex;
    gap: 16px;
    margin: 30px 0;
}
.article-nav-link {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}
.article-nav-link:hover {
    border-color: var(--accent);
    background: var(--surface-2);
}
.article-nav-next { text-align: right; margin-left: auto; }
.article-nav-dir {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--accent-text);
}
.article-nav-title {
    font-weight: 600;
    color: var(--heading-fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .article-nav { flex-direction: column; }
    .article-nav-next { text-align: left; }
}

/* Related articles (same category) on article detail */
.ja-related {
    max-width: 70ch;
    margin: 28px 0 8px;
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
}
.ja-related-title {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--fg-muted);
    margin: 0 0 14px;
}
.ja-related-title a {
    color: var(--phosphor);
    text-decoration: none;
}
.ja-related-title a:hover,
.ja-related-title a:focus-visible {
    text-decoration: underline;
    outline: none;
}
.ja-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ja-related-item {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}
.ja-related-link {
    font-weight: 600;
    color: var(--fg-2);
    text-decoration: none;
}
.ja-related-link:hover,
.ja-related-link:focus-visible {
    color: var(--accent-text);
    outline: none;
}
.ja-related-summary {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--fg-muted);
    line-height: 1.45;
}
.ja-related-meta {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--fg-4);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.ja-eyebrow-link {
    color: inherit;
    text-decoration: none;
}
.ja-eyebrow-link:hover,
.ja-eyebrow-link:focus-visible {
    text-decoration: underline;
    outline: none;
}


.like-form {
    display: inline-block;
}

.btn-like {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: var(--surface-2);
    border: 2px solid var(--accent);
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    color: var(--fg-2);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
}

.btn-like:hover {
    background-color: var(--accent);
    color: var(--accent-fg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent);
}

.btn-like.liked {
    background-color: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent-hover);
}

.btn-like.liked:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent);
}

.like-icon {
    font-size: 20px;
    line-height: 1;
}

.like-text {
    font-weight: bold;
}

.like-count {
    background-color: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
}

.btn-like.liked .like-count {
    background-color: rgba(255, 255, 255, 0.2);
}

.like-prompt {
    text-align: center;
}

.like-prompt .btn-like {
    margin-bottom: 10px;
}

.like-login-hint {
    color: var(--fg-muted);
    font-size: 14px;
    margin-top: 10px;
}

.like-login-hint a {
    color: var(--accent-text);
    text-decoration: none;
    font-weight: bold;
}

.like-login-hint a:hover {
    text-decoration: underline;
}

.article-detail-actions {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* 评论区样式 */
.article-comments-section {
    background-color: var(--surface);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid var(--line);
    scroll-margin-top: 90px; /* #comments clears sticky header */
}

.article-comments-section h2 {
    color: var(--fg-2);
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
}

.article-add-comment-form {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.article-comment-textarea, .article-reply-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--line);
    border-radius: 6px;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.article-comment-textarea:focus, .article-reply-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

.article-login-prompt {
    text-align: center;
    padding: 20px;
    background-color: var(--surface-2);
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid var(--bg-cool);
}

.article-comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-comment-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--content-bg);
}

.article-comment-item:last-child {
    border-bottom: none;
}

.article-comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.article-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.article-comment-author {
    flex: 1;
}

.article-comment-author .author-name {
    font-weight: bold;
    color: var(--fg-2);
}

.article-comment-date {
    color: var(--fg-muted);
    font-size: 12px;
}

.article-delete-comment-form, .article-delete-reply-form {
    margin-left: auto;
}

.article-btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.article-btn-delete:hover {
    opacity: 1;
}

.article-comment-content {
    color: var(--fg-2);
    line-height: 1.6;
    margin-bottom: 10px;
}

.article-comment-actions {
    margin-bottom: 10px;
}

.article-btn-reply {
    background: none;
    border: none;
    color: var(--accent-text);
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
    font-weight: bold;
}

.article-btn-reply:hover {
    color: var(--accent-hover);
}

.article-reply-form {
    margin-left: 44px;
    margin-top: 15px;
    padding: 15px;
    background-color: var(--surface-2);
    border-radius: 6px;
    border: 1px solid var(--bg-cool);
}

.article-reply-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.article-replies {
    margin-left: 44px;
    margin-top: 15px;
}

.article-reply-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--content-bg);
}

.article-reply-item:last-child {
    border-bottom: none;
}

.article-reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.article-reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.article-reply-author {
    flex: 1;
}

.article-reply-author .author-name {
    font-weight: bold;
    color: var(--fg-2);
    font-size: 14px;
}

.article-reply-date {
    color: var(--fg-muted);
    font-size: 12px;
}

.article-reply-content {
    color: var(--fg-2);
    line-height: 1.5;
    font-size: 14px;
}

.article-no-comments {
    text-align: center;
    padding: 40px;
    background-color: var(--surface-2);
    border-radius: 10px;
    color: var(--fg-muted);
}

/* 文章创建/编辑页面 */
.article-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.article-form-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--accent);
}

.article-form-page-header h1 {
    color: var(--fg-2);
    margin: 0;
    font-weight: bold;
}

.article-form-header-actions {
    display: flex;
    gap: 10px;
}

.article-form {
    background-color: var(--surface);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid var(--line);
}

.article-form-group {
    margin-bottom: 25px;
}

.article-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--fg-2);
}

.article-form-required {
    color: var(--danger);
}

.article-form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--line);
    border-radius: 6px;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    transition: border-color 0.3s ease;
}

.article-form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

.article-content-textarea {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

.article-form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--fg-muted);
}

.article-form-actions {
    display: flex;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* 文章预览模态框 */
.article-preview-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.article-preview-modal-content {
    background-color: var(--surface);
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--line);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.article-preview-modal-header {
    padding: 20px;
    border-bottom: 2px solid var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-preview-modal-header h2 {
    margin: 0;
    color: var(--fg-2);
    font-weight: bold;
}

.article-preview-close {
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    color: var(--fg-faint);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.article-preview-close:hover {
    color: var(--accent-text);
}

.article-preview-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.article-preview-modal-body {
    padding: 20px;
}

.article-preview-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--line);
    text-align: right;
}

.article-preview-content {
    line-height: 1.8;
    color: var(--fg-2);
}

.article-preview-content h1, .article-preview-content h2, .article-preview-content h3 {
    color: var(--fg-2);
    margin-top: 20px;
    margin-bottom: 10px;
}

.article-preview-content p {
    margin-bottom: 15px;
}

/* 通用隐藏类 */
.hidden {
    display: none;
}

/* 通用按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--accent);
    color: var(--accent-fg);
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    text-align: center;
}

.btn:hover {
    background-color: var(--accent-hover);
    color: white;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--accent-fg);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    color: white;
}

.btn-secondary {
    background-color: var(--neutral-btn);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--neutral-btn-hover);
}

.btn-outline {
    background-color: transparent;
    color: var(--neutral-btn);
    border: 2px solid var(--neutral-btn);
}

.btn-outline:hover {
    background-color: var(--neutral-btn);
    color: white;
}

.btn-danger {
    background-color: var(--danger);
    color: var(--on-danger);
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 文章页面响应式设计 */
@media (max-width: 768px) {
    .articles-container, .article-detail-container, .article-form-container {
        padding: 10px;
    }
    
    .articles-page-header, .article-form-page-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .articles-search-form {
        flex-direction: column;
    }
    
    .articles-search-input-group {
        min-width: auto;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .article-detail, .article-comments-section, .article-form {
        padding: 20px;
    }
    
    .article-back-section {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .btn-back {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .back-icon {
        font-size: 16px;
    }
    
    .article-detail-title {
        font-size: 24px;
    }
    
    .article-detail-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .article-tags-category {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    /* 移动端：让 article-detail-header 可滚动 */
    .article-detail-header {
        max-height: 40vh; /* 最大高度为视口高度的40%，避免占用太多空间 */
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
        /* 添加内边距，确保内容不会紧贴边缘 */
        padding-right: 10px;
    }
    
    /* 滚动条样式（Firefox 和 Chrome 121+） */
    /* Safari 和 Chrome < 121 会使用下面的 webkit 滚动条样式 */
    @supports (scrollbar-width: thin) {
        .article-detail-header {
            scrollbar-width: thin;
            scrollbar-color: var(--accent) var(--content-bg);
        }
    }
    
    /* Webkit 浏览器滚动条样式（Chrome, Safari, Edge） */
    .article-detail-header::-webkit-scrollbar {
        width: 6px;
    }
    
    .article-detail-header::-webkit-scrollbar-track {
        background: var(--content-bg);
        border-radius: 3px;
    }
    
    .article-detail-header::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 3px;
    }
    
    .article-detail-header::-webkit-scrollbar-thumb:hover {
        background: var(--accent-hover);
    }
    
    .article-replies {
        margin-left: 20px;
    }
    
    .article-reply-form {
        margin-left: 20px;
    }
    
    .article-form-header-actions {
        flex-direction: column;
    }
    
    .article-form-actions {
        flex-direction: column;
    }
    
    .article-preview-modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Role-based Permission System Styles */
.user-info {
    background-color: var(--surface-2);
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid var(--accent);
}

.user-info p {
    margin: 5px 0;
    font-size: 14px;
}

.role-badge {
    /* A tinted pill rather than a solid fill: white on the solid red was
       3.3:1, and each theme already carries a matched bg/line/fg triple for
       these five states, so the badge stays legible in all twelve. */
    background-color: var(--info-bg);
    color: var(--info-fg);
    border: 1px solid var(--info-line);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.permissions {
    color: var(--fg-muted);
    font-size: 12px;
    font-style: italic;
}

/* Permission Control Styles */
.permission-restricted {
    opacity: 0.6;
    pointer-events: none;
}

.permission-notice {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning-line);
    color: var(--warning-fg);
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
}

/* Role-specific Styles */
.role-admin .role-badge {
    background-color: var(--danger-bg);
    color: var(--danger-fg);
    border-color: var(--danger-line);
}

.role-app_manager .role-badge {
    background-color: var(--success-bg);
    color: var(--success-fg);
    border-color: var(--success-line);
}

.role-user_manager .role-badge {
    background-color: var(--warning-bg);
    color: var(--warning-fg);
    border-color: var(--warning-line);
}

.role-developer .role-badge {
    /* the one state with no themed triple; the purple is dark enough that
       white clears AA on it in every theme */
    background-color: #6f42c1;
    color: #ffffff;
    border-color: #6f42c1;
}

.role-manager .role-badge {
    background-color: var(--info-bg);
    color: var(--info-fg);
    border-color: var(--info-line);
}

/* Admin Storage Management Styles */
.admin-storage-actions {
    margin-top: 20px;
    padding: 15px;
    background: var(--surface-2);
    border-radius: 8px;
    border: 2px solid var(--danger);
}

.admin-storage-actions h4 {
    margin: 0 0 15px 0;
    color: var(--danger);
    font-size: 16px;
    font-weight: bold;
}

.admin-grant-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.admin-grant-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.admin-grant-form label {
    font-size: 14px;
    font-weight: bold;
    color: var(--fg-2);
}

.admin-storage-input {
    padding: 8px 12px;
    border: 1px solid var(--danger);
    border-radius: 5px;
    font-size: 14px;
    width: 100%;
    max-width: 200px;
}

.admin-grant-btn {
    background: var(--danger);
    color: var(--on-danger);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    width: fit-content;
}

.admin-grant-btn:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
}

.storage-info {
    margin-top: 30px;
    padding: 20px;
    background: var(--content-bg);
    border-radius: 10px;
    border: 2px solid var(--accent);
}

.storage-info h3 {
    margin: 0 0 15px 0;
    color: var(--fg-2);
    font-size: 18px;
    font-weight: bold;
}

.storage-bar-container {
    margin-bottom: 15px;
}

.storage-bar {
    width: 100%;
    height: 25px;
    background-color: var(--bg-cool);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--line);
}

.storage-used {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    transition: width 0.3s ease;
}

.storage-text {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--fg-muted);
    font-weight: bold;
}

.storage-used-text {
    font-weight: bold;
    color: var(--accent-text);
}

.storage-total-text {
    color: var(--fg-muted);
}

.storage-percentage {
    color: var(--fg-2);
    font-weight: bold;
}

.storage-details {
    margin-top: 15px;
}

.storage-remaining {
    margin: 0 0 10px 0;
    color: var(--fg-muted);
    font-size: 14px;
    font-weight: bold;
}

.storage-warning {
    margin-top: 10px;
    padding: 12px;
    background: var(--warning-bg);
    border: 2px solid var(--warning-line);
    border-radius: 8px;
    color: var(--warning-fg);
    font-size: 14px;
    font-weight: bold;
}

.storage-danger {
    margin-top: 10px;
    padding: 12px;
    background: var(--danger-bg);
    border: 2px solid var(--danger-line);
    border-radius: 8px;
    color: var(--danger-fg);
    font-size: 14px;
    font-weight: bold;
}

.storage-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.storage-action-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--accent);
    color: var(--accent-fg);
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.storage-action-btn:hover {
    background-color: var(--accent-hover);
    color: white;
    transform: translateY(-1px);
}

.storage-action-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* Fixed header responsive design */
@media (max-width: 768px) {
    header {
        padding: 8px 14px 6px;
    }

    header > nav {
        padding: 6px 0 2px;
        margin: 0;
        gap: 2px;
    }

    .logo-text {
        font-size: 20px;
        padding-left: 26px;
    }

    .nav-bar {
        padding: 6px 10px;
        font-size: 13.5px;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .storage-text {
        flex-direction: column;
        gap: 5px;
    }
    
    .storage-actions {
        flex-direction: column;
    }
    
    .storage-action-btn {
        text-align: center;
    }
}

/* 应用详情页样式 */
.app-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.app-back-section {
    margin-bottom: 20px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--content-bg);
    color: var(--fg-2);
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background-color: var(--accent);
    color: var(--accent-fg);
}

.back-icon {
    font-size: 18px;
}

.app-detail-header {
    background-color: var(--surface);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.app-detail-title-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.app-detail-name {
    color: var(--fg-2);
    font-size: 32px;
    font-weight: bold;
    margin: 0;
    line-height: 1.3;
}

.app-detail-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.app-version-badge {
    display: inline-block;
    padding: 5px 12px;
    background-color: var(--accent);
    color: var(--accent-fg);
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
}

.app-category-badge {
    display: inline-block;
    padding: 5px 12px;
    background-color: var(--neutral-btn);
    color: white;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
}

.app-status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
}

.app-status-badge.approved {
    background-color: var(--success);
    color: var(--on-success);
}

.app-status-badge.pending {
    background-color: var(--warning);
    color: var(--fg-2);
}

.app-detail-screenshot {
    margin-bottom: 30px;
    text-align: center;
}

.app-screenshot-img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.app-detail-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin-bottom: 30px;
}

.app-detail-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.app-detail-section {
    background-color: var(--surface);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.app-section-title {
    color: var(--fg-2);
    font-size: 22px;
    font-weight: bold;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}

.app-description-full {
    font-size: 16px;
    line-height: 1.8;
    color: var(--fg-2);
}

.app-description-full p {
    margin: 0 0 15px 0;
}

.app-info-table {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.app-info-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.app-info-row:last-child {
    border-bottom: none;
}

.app-info-label {
    font-weight: bold;
    color: var(--fg-muted);
}

.app-info-value {
    color: var(--fg-2);
}

.email-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-email-link {
    color: var(--accent-text);
    text-decoration: none;
    flex: 1;
}

.app-email-link:hover {
    text-decoration: underline;
}

.btn-copy-email {
    background-color: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy-email:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--accent-fg);
}

.copy-icon {
    font-size: 16px;
}

.app-user-link {
    color: var(--accent-text);
    text-decoration: none;
    font-weight: bold;
}

.app-user-link:hover {
    text-decoration: underline;
}

.app-download-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.app-download-type {
    font-size: 16px;
    color: var(--fg-2);
}

.app-download-note {
    padding: 15px;
    background-color: var(--surface-2);
    border-radius: 5px;
    border-left: 4px solid var(--accent);
}

.app-download-note p {
    margin: 0;
    color: var(--fg-muted);
}

.app-no-download {
    color: var(--danger);
    font-weight: bold;
}

.app-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.app-action-card,
.app-quick-info-card {
    background-color: var(--surface);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.app-action-title,
.app-quick-info-title {
    color: var(--fg-2);
    font-size: 20px;
    font-weight: bold;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}

.app-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-download-primary,
.btn-contact-developer,
.btn-edit-app {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-download-primary {
    background-color: var(--accent);
    color: var(--accent-fg);
}

.btn-download-primary:hover {
    background-color: var(--accent-hover);
    color: white;
}

.contact-developer-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-contact-developer {
    background-color: var(--info);
    color: var(--on-info);
}

.btn-contact-developer:hover {
    background-color: #138496;
    color: white;
}

.btn-copy-email-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    background-color: var(--neutral-btn);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
}

.btn-copy-email-inline:hover {
    background-color: var(--neutral-btn-hover);
    color: white;
}

.contact-hint {
    margin: 0;
    font-size: 12px;
    color: var(--fg-muted);
    font-style: italic;
    text-align: center;
}

.btn-edit-app {
    background-color: var(--neutral-btn);
    color: white;
}

.btn-edit-app:hover {
    background-color: var(--neutral-btn-hover);
    color: white;
}

.download-icon,
.contact-icon,
.edit-icon {
    font-size: 18px;
}

.app-quick-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-quick-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: var(--surface-2);
    border-radius: 5px;
}

.quick-info-icon {
    font-size: 20px;
}

.quick-info-text {
    color: var(--fg-2);
    font-weight: 500;
}

.app-legal-disclaimer {
    background-color: var(--warning-bg);
    border: 2px solid var(--warning);
    border-radius: 10px;
    padding: 25px;
    margin-top: 30px;
}

.app-legal-disclaimer h3 {
    color: var(--warning-fg);
    margin: 0 0 15px 0;
    font-size: 20px;
}

.disclaimer-content {
    color: var(--warning-fg);
}

.disclaimer-content p {
    margin: 10px 0;
}

.disclaimer-content ul {
    margin: 10px 0;
    padding-left: 25px;
}

.disclaimer-content li {
    margin: 8px 0;
}

/* 应用列表页链接样式 */
.app-name-link {
    color: var(--fg-2);
    text-decoration: none;
    transition: color 0.3s ease;
}

.app-name-link:hover {
    color: var(--accent-text);
}

.view-details-button {
    flex: 1;
    padding: 10px;
    text-align: center;
    background-color: var(--neutral-btn);
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.view-details-button:hover {
    background-color: var(--neutral-btn-hover);
    color: white;
}

/* 应用详情页响应式设计 */
@media (max-width: 968px) {
    .app-detail-content {
        grid-template-columns: 1fr;
    }
    
    .app-detail-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .app-detail-container {
        padding: 10px;
    }
    
    .app-detail-header,
    .app-detail-section,
    .app-action-card,
    .app-quick-info-card {
        padding: 20px;
    }
    
    .app-detail-name {
        font-size: 24px;
    }
    
    .app-info-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .app-info-label {
        font-size: 14px;
    }
    
    .app-action-buttons {
        gap: 10px;
    }
    
    .btn-download-primary,
    .btn-contact-developer,
    .btn-edit-app {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* 主题切换器样式 */
.theme-selector {
    position: relative;
    display: inline-block;
}

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 5px 10px;
    margin-left: 10px;
}

.theme-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    margin-top: 5px;
}

.theme-panel.show {
    display: block;
}

.theme-panel-header {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-3);
    font-weight: bold;
    background: var(--surface-2);
}

.theme-panel-body {
    padding: 10px;
}

.theme-checkbox-label {
    display: block;
    padding: 8px;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.theme-checkbox-label:hover {
    background: var(--surface-2);
}

.theme-checkbox-label input {
    margin-right: 8px;
    accent-color: var(--jm-green);
}

/* =====================================================================
   JMDrive — design tokens + Drive page / Link-settings modal / public Share page
   Tokens are scoped to :root and only referenced by the JMDrive styles below;
   existing rules use hard-coded hex and are unaffected.
   ===================================================================== */
:root {
    --jm-green: var(--accent);
    --jm-green-hover: var(--accent-hover);
    --jm-green-tint-10: color-mix(in srgb, var(--accent) 10%, transparent);
    --jm-green-tint-20: color-mix(in srgb, var(--accent) 20%, transparent);
    --bg-subtle: var(--surface-2);
    --bg-cool: var(--content-bg);
    --fg-2: var(--fg);
    --fg-3: var(--fg-muted);
    --fg-4: var(--fg-muted);
    --fg-5: var(--fg-muted);
    --border: var(--line);       /* legacy name, kept: used in ~40 rules */
    --border-3: var(--line);
    --success: #28a745;
    --success-bg: #d4edda;
    --success-fg: #155724;
    --warning: #ffc107;
    --warning-bg: #fff3cd;
    --warning-fg: #856404;
    --danger: #d83444;
    --danger-hover: #c82333;
    --danger-bg: #f8d7da;
    --danger-fg: #721c24;
    --info: #17a2b8;
    --info-bg: #d1ecf1;
    --info-line: #bee5eb;
    --info-fg: #0c5460;
    --success-line: #c3e6cb;
    --warning-line: #ffeaa7;
    --danger-line: #f5c6cb;
    --neutral-fg: #383d41;
    --fg-faint: #aaa;
    --neutral-btn: #6c757d;
    --neutral-btn-hover: #5a6268;
    --font-sans: Arial, Helvetica, sans-serif;
    --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    --fw-bold: 700;
    --r-sm: 4px;
    --r-md: 5px;
    --r-lg: 8px;
    --r-xl: 10px;
    --r-pill: 50px;
    --r-full: 9999px;
    --sh-card: 0 2px 5px rgba(0, 0, 0, 0.10);
    --sh-hover: 0 4px 15px rgba(0, 0, 0, 0.15);
    --sh-pop: 0 6px 20px rgba(0, 0, 0, 0.30);
    --grad-storage: linear-gradient(90deg, #0F9D58, #0A7D45);

    /* ---- Theme surface tokens -------------------------------------------
       The values a theme changes, and the only ones it should need to.

       Themes used to re-skin the site by enumerating every surface class and
       overriding it with !important — one line naming 107 classes, another
       with 60 :not() exclusions. That meant adding a single new card meant
       editing twelve files, and it made the colours unusable from a page's
       own stylesheet, because the theme would always win. A theme is now a
       dozen variables; nothing below needs !important.

       These carry the current light values, so defining them changes nothing
       on its own. The rules below adopt them next. */
    --page-bg: #ffffff;
    /* The nav bar and the header have their own background tokens, but their
       text was taking --heading-fg. A theme that gives the nav a dark bar and
       the page dark text (GitHub Light does both) then painted black on black. */
    --nav-fg: #0C1512;
    --header-fg: #0C1512;
    --header-bg: rgba(255, 255, 255, 0.88);
    --nav-bg: transparent;
    --surface: #ffffff;          /* cards, panels, popovers */
    --surface-2: #f8f9fa;        /* subtle fills inside a surface */
    --content-bg: #f0f0f0;       /* the .page-content shell */
    --input-bg: #ffffff;
    --code-bg: #1e1e1e;          /* code blocks are dark in every theme */
    --code-fg: #e6e6e6;
    --fg: #363636;               /* body text */
    --fg-muted: #5e5e5e;         /* secondary text, placeholders */
    --heading-fg: #0C1512;
    --link: #0b6d3d;
    --accent-color: var(--accent);
    --accent: #0F9D58;           /* brand: primary buttons, active states */
    --accent-fg: #0d0d0d;        /* text on --accent */
    --accent-hover: #0d8f4f;
    --line: #dddddd;             /* borders and rules */
    --footer-bg: #0A1410;
    --footer-fg: #AFC6BA;

    /* ---- Brand ink -------------------------------------------------------
       The dark band at the top of a page, and the green on it. Fixed on
       purpose: it is the site's identity, the same way the footer is already
       dark in the light theme, so it does not move when someone picks a
       theme. Everything *below* a band uses the surface tokens above and
       themes normally — which is the part /projects currently gets wrong by
       hardcoding its own paper colours. */
    --ink: #0A1410;
    --ink-2: #10201A;
    --ink-line: #21382E;
    --ink-fg: #E7F3EC;
    --ink-fg-dim: #AFC6BA;
    --ink-fg-faint: #7E978A;
    --phosphor: #3DDC84;
    --phosphor-deep: #0F9D58;
    /* The same green one step darker, for the ink design's light sections.
       #0F9D58 on paper is 3.2:1 — under AA for body-size text — while on the
       ink canvas it is fine, so the two cases need two tokens. */
    --phosphor-paper: #0C7F47;
    /* States on that same fixed paper. A theme's --danger-fg is tuned for
       the themed surfaces and turns light under a dark theme, which is
       unreadable here; these stay put, like the rest of the ink palette.
       Each clears 5:1 on white, the paper and the warning tint. */
    --danger-paper: #B3261E;
    --warning-paper: #8A6100;
    --success-paper: #1F7A3D;
    --amber: #E8B341;
    /* The rest of the ink palette, promoted out of five templates that each
       declared their own copy inside an inline <style> — with literals and
       !important on top of the copy. One definition, one place to change it. */
    --ink-deep: #061009;
    --ink-deeper: #04120A;
    --ink-head: #0B1811;
    --ink-text: #0C1512;
    --ink-dot: #23382D;
    --ink-dot-2: #2E5A44;
    --ink-sep: #3B5A4B;
    --ink-fg-soft: #DCEDE3;
    --ink-fg-bright: #F3FBF6;
    --ink-fg-mid: #C4D6CB;
    --ink-fg-mute: #9FB8AA;
    --ink-fg-quiet: #8AA396;
    --ink-fg-low: #7E9A8B;
    --ink-fg-dimmer: #6F8A7C;
    --ink-fg-placeholder: #5E7A6C;
    --paper: #F6F7F4;
    --paper-2: #FFFFFF;
    --paper-3: #FAFBF9;
    --paper-line: #E3E6E0;
    --paper-line-2: #EDEFEA;
    --paper-fg: #0C1512;
    --paper-fg-muted: #5B6B63;
    --paper-fg-dim: #6B7A72;
    --paper-fg-faint: #46564E;
    --paper-label: #33463D;
    --paper-rule: #C4CCC7;
    --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --display: 'Space Grotesk', system-ui, -apple-system, sans-serif;

    /* Foreground for a SOLID fill of each state (a filled Delete button,
       not a tinted alert). White on the dark themes' lighter red was
       3.3:1; this picks whichever of white/near-black actually reads. */
    --on-danger: #ffffff;
    --on-success: #0d0d0d;
    --on-warning: #0d0d0d;
    --on-info: #0d0d0d;

    /* The accent as TEXT. A fill can be as bright as it likes, but the
       same green as small type is 2.4:1 on white; this is the accent
       nudged until it clears AA on every surface this theme defines. */
    --accent-text: #0a6c3d;
}

/* buttons used by JMDrive / share surfaces */
.btn { display: inline-block; padding: 12px 24px; border: none; border-radius: var(--r-md); font-weight: var(--fw-bold); font-size: 15px; cursor: pointer; font-family: var(--font-sans); transition: all .3s ease; text-decoration: none; text-align: center; }
.btn-primary { background: var(--jm-green); color: var(--accent-fg); }
.btn-primary:hover { background: var(--jm-green-hover); color: var(--surface); }
/* --neutral-btn is the same mid-grey in every theme, so its text is
   fixed white rather than a surface colour that flips with the theme. */
.btn-secondary { background: var(--neutral-btn); color: #ffffff; }
.btn-secondary:hover { background: var(--neutral-btn-hover); color: #ffffff; }

/* ---------- JMDRIVE --------------------------------------------- */
.drive-titlebar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.drive-titlebar-actions { display: flex; gap: 10px; }
.drive-storage { background: var(--surface-2); border: 2px solid var(--jm-green); border-radius: var(--r-xl); padding: 18px 20px; margin-bottom: 20px; }
.drive-storage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.drive-storage-head h3 { margin: 0 0 4px; color: var(--fg-2); font-size: 17px; }
.drive-storage-head p { margin: 0; color: var(--fg-4); font-size: 13px; }
.drive-status { padding: 5px 12px; border-radius: var(--r-md); font-weight: bold; font-size: 12px; white-space: nowrap; }
.drive-status.status-ok { background: var(--success-bg); color: var(--success-fg); }
.drive-status.status-warning { background: var(--warning-bg); color: var(--warning-fg); }
.drive-status.status-danger { background: var(--danger-bg); color: var(--danger-fg); }
.drive-bar { width: 100%; height: 20px; background: var(--bg-cool); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.drive-bar-fill { height: 100%; background: var(--grad-storage); transition: width .3s ease; }
.drive-bar-text { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: bold; }
.drive-bar-text .used { color: var(--accent-text); }
.drive-bar-text .sep, .drive-bar-text .total { color: var(--fg-muted); }
.drive-bar-text .pct { color: var(--fg-2); }
.drive-bar-text .remaining { margin-left: auto; color: var(--fg-5); font-weight: normal; }
.drive-tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--border); margin-bottom: 12px; }
.drive-tab { border: none; background: none; cursor: pointer; padding: 10px 18px; font-family: var(--font-sans); font-weight: bold; font-size: 15px; color: var(--fg-4); border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .3s ease; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.drive-tab:hover { color: var(--fg-2); }
.drive-tab.active { color: var(--accent-text); border-bottom-color: var(--jm-green); }
.drive-tab-count { background: var(--bg-cool); color: var(--fg-4); border-radius: var(--r-full); font-size: 12px; padding: 1px 9px; font-weight: bold; }
.drive-tab.active .drive-tab-count { background: var(--jm-green); color: var(--accent-fg); }
.drive-tab-hint { margin: 0 0 16px; color: var(--fg-4); font-size: 13px; }
.drive-vis { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--r-full); font-size: 12px; font-weight: bold; white-space: nowrap; }
.drive-vis.is-public { background: var(--success-bg); color: var(--success-fg); }
.drive-vis.is-private { background: var(--bg-cool); color: var(--fg-4); }
.drive-tile-vis { margin-top: 8px; }
.drive-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.drive-breadcrumb { font-size: 14px; color: var(--fg-4); }
.drive-breadcrumb .crumb.active { color: var(--fg-2); font-weight: bold; }
.drive-toolbar-right { display: flex; gap: 10px; align-items: center; }
.drive-search { padding: 9px 13px; border: 2px solid var(--border); border-radius: 6px; font-size: 14px; font-family: var(--font-sans); background: var(--surface); min-width: 220px; }
.drive-search:focus { outline: none; border-color: var(--jm-green); }
.drive-view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.view-btn { border: none; background: var(--surface); padding: 8px 12px; cursor: pointer; font-size: 15px; color: var(--fg-4); transition: all .3s ease; text-decoration: none; }
.view-btn + .view-btn { border-left: 1px solid var(--border); }
.view-btn.active { background: var(--jm-green); color: var(--accent-fg); }
.drive-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; }
.drive-row { display: grid; grid-template-columns: 2fr 1fr 0.7fr 1.1fr 1.9fr; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border-3); transition: background .3s ease; }
.drive-row:last-child { border-bottom: none; }
.drive-row.drive-head { background: var(--surface-2); font-weight: bold; color: var(--fg-4); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.drive-row:not(.drive-head):hover { background: var(--surface-2); }
.drive-cell { font-size: 14px; color: var(--fg-3); }
.drive-cell.name { display: flex; align-items: center; gap: 10px; }
.drive-row-icon { font-size: 20px; line-height: 1; }
.drive-row-name { font-weight: bold; color: var(--fg-2); word-break: break-word; }
.drive-cell.size, .drive-cell.date { color: var(--fg-5); }
.drive-cell.actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.drive-action { background: none; border: none; padding: 0; font-family: var(--font-sans); color: var(--accent-text); font-weight: bold; font-size: 13px; cursor: pointer; text-decoration: none; }
.drive-action:hover { color: var(--jm-green-hover); }
.drive-action.danger { color: var(--danger); }
.drive-action.danger:hover { color: var(--danger-hover); }
.drive-action:focus-visible { outline: 2px solid var(--phosphor, var(--jm-green)); outline-offset: 2px; }
.drive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.drive-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 20px 14px; text-align: center; box-shadow: var(--sh-card); transition: all .3s ease; }
.drive-tile:hover { transform: translateY(-2px); box-shadow: var(--sh-hover); }
.drive-tile-icon { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.drive-tile-name { font-weight: bold; color: var(--fg-2); font-size: 13px; word-break: break-word; }
.drive-tile-meta { color: var(--fg-5); font-size: 12px; margin-top: 4px; }
.drive-empty { padding: 40px; text-align: center; color: var(--fg-4); grid-column: 1/-1; }
@media (max-width: 720px) {
    .drive-row { grid-template-columns: 2fr 1fr 1.4fr; }
    .drive-cell.vis, .drive-cell.actions { display: none; }
    .drive-search { min-width: 140px; }
}

/* ---------- LINK SETTINGS MODAL --------------------------------- */
.modal-overlay { position: fixed; inset: 0; z-index: 1200; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding: 80px 20px 40px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--r-xl); width: 100%; max-width: 480px; box-shadow: var(--sh-pop); overflow: hidden; animation: modalIn .3s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border-3); }
.modal-head h3 { margin: 0; color: var(--fg-2); font-size: 18px; }
.modal-x { font-size: 24px; color: var(--fg-5); cursor: pointer; line-height: 1; }
button.modal-x { background: none; border: none; padding: 0; font: inherit; }
.modal-x:hover { color: var(--fg-2); }
.modal-x:focus-visible { outline: 2px solid var(--phosphor, var(--jm-green)); outline-offset: 2px; }
.modal-fileline { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.modal-file-icon { font-size: 22px; }
.modal-file-name { font-weight: bold; color: var(--fg-2); flex: 1; word-break: break-word; }
.share-link-box { display: flex; gap: 8px; padding: 14px 20px; }
.share-link-box input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); font-family: var(--font-mono); font-size: 13px; background: var(--surface-2); color: var(--fg-3); }
.share-link-box .btn { padding: 10px 18px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--border-3); }
.setting-label { display: flex; flex-direction: column; gap: 2px; }
.setting-label strong { color: var(--fg-2); font-size: 14px; }
.setting-label span { color: var(--fg-5); font-size: 12px; }
.setting-input { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-md); font-size: 14px; font-family: var(--font-sans); background: var(--surface); }
.setting-input:focus { outline: none; border-color: var(--jm-green); box-shadow: 0 0 0 3px var(--jm-green-tint-10); }
.setting-input.full { display: block; width: calc(100% - 40px); margin: 0 20px 4px; box-sizing: border-box; }
.setting-input.has-error { border-color: var(--danger); }
.stat-readout { background: var(--surface-2); }
.download-count { font-size: 22px; font-weight: bold; color: var(--accent-text); }
.download-count .of { color: var(--fg-5); font-size: 15px; font-weight: normal; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border-3); background: var(--surface-2); }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; cursor: pointer; background: var(--bg-cool); border-radius: var(--r-full); transition: background .3s ease; }
.slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: var(--surface); border-radius: 50%; transition: transform .3s ease; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .slider { background: var(--jm-green); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------- PUBLIC SHARE PAGE ----------------------------------- */
.share-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface-2); }
.share-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--border-3); }
.share-wordmark { font-weight: var(--fw-bold); font-size: 24px; color: #000; }
.share-host { font-family: var(--font-mono); font-size: 13px; color: var(--fg-5); }
.share-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 48px 20px; }
.share-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-card); padding: 40px 36px; max-width: 520px; width: 100%; text-align: center; }
.share-file-icon { font-size: 64px; line-height: 1; margin-bottom: 14px; }
.share-file-name { margin: 0 0 10px; font-size: 26px; color: var(--fg-2); word-break: break-word; }
.share-file-meta { display: flex; gap: 8px; justify-content: center; color: var(--fg-5); font-size: 14px; flex-wrap: wrap; }
.share-shared-by { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 18px 0; color: var(--fg-4); font-size: 14px; }
.share-shared-by img { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--jm-green); object-fit: cover; }
.share-preview { margin: 18px 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
.share-preview img { display: block; width: 100%; height: auto; }
.share-dl { width: 100%; padding: 14px; font-size: 16px; margin-top: 8px; }
.share-done { margin-top: 14px; color: var(--success); font-weight: bold; }
.share-blocked { margin: 18px 0 6px; padding: 16px; border-radius: var(--r-lg); background: var(--warning-bg); color: var(--warning-fg); font-weight: bold; font-size: 15px; }
.share-lock { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.share-lock-icon { font-size: 40px; margin: 6px 0; }
.share-lock p { color: var(--fg-4); margin: 0 0 12px; font-size: 14px; }
.share-lock .setting-input.full { width: 100%; margin: 0 0 4px; }
.share-error { color: var(--danger); font-size: 13px; font-weight: bold; }
.share-stats { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-3); color: var(--fg-5); font-size: 13px; }
.share-disclaimer { max-width: 520px; text-align: center; color: var(--fg-5); font-size: 12px; line-height: 1.6; margin: 24px 0 8px; }
.share-footer { text-align: center; padding: 16px; background: var(--jm-green); color: var(--accent-fg); font-weight: var(--fw-bold); }

/* ---------- JMDRIVE folders ------------------------------------- */
.drive-row.is-folder .drive-cell.name { cursor: pointer; }
.drive-tile.is-folder { cursor: pointer; }
.drive-breadcrumb .crumb { color: var(--fg-4); text-decoration: none; }
.drive-breadcrumb a.crumb:hover { color: var(--accent-text); }
.drive-breadcrumb .crumb-sep { color: var(--fg-5); margin: 0 4px; }
.drive-dropzone { position: fixed; inset: 0; z-index: 1300; display: none; align-items: center; justify-content: center; background: var(--jm-green-tint-10); }
.drive-dropzone.active { display: flex; }
.drive-dropzone-inner { background: var(--surface); border: 3px dashed var(--jm-green); border-radius: var(--r-xl); padding: 40px 60px; font-size: 20px; font-weight: bold; color: var(--jm-green); box-shadow: var(--sh-pop); }
.drive-drop-hint { color: var(--fg-5); font-size: 13px; margin: 0 0 12px; }

/* ================================================================
   CHAT — private messages + group chats (on-brand: green bubbles)
   ================================================================ */
.chat-shell { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 320px); min-height: 560px; border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); box-shadow: var(--sh-card); margin-top: 16px; }
.chat-avatar-img { border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--bg-cool); }
.chat-avatar-img.ring { border: 2px solid var(--jm-green); }
.chat-group-av { position: relative; flex: 0 0 auto; }
.chat-group-av img { position: absolute; border-radius: 50%; border: 2px solid var(--surface); object-fit: cover; background: var(--bg-cool); }
.chat-group-av img.g1 { top: 0; left: 0; }
.chat-group-av img.g2 { bottom: 0; right: 0; }

/* sidebar */
.chat-sidebar { border-right: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-sidebar-head { padding: 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; background: var(--surface); position: relative; }
.chat-search { width: 100%; padding: 10px 12px; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--r-pill); font-size: 14px; font-family: var(--font-sans); }
.chat-search:focus { outline: none; border-color: var(--jm-green); box-shadow: 0 0 0 3px var(--jm-green-tint-10); }
.chat-newgroup { padding: 10px 14px; font-size: 14px; }
.user-search-results { position: absolute; top: 60px; left: 14px; right: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); max-height: 300px; overflow-y: auto; z-index: 1000; display: none; box-shadow: var(--sh-hover); }
.user-search-result-item { padding: 10px 12px; cursor: pointer; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-3); }
.user-search-result-item:hover { background: var(--surface-2); }
.user-search-result-item img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.user-search-result-name { font-weight: bold; color: var(--fg-2); font-size: 14px; }
.chat-conv-list { flex: 1; overflow-y: auto; }
.chat-conv { display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border-3); border-left: 3px solid transparent; transition: background 0.3s ease; text-decoration: none; }
.chat-conv:hover { background: var(--surface); }
.chat-conv.active { background: var(--jm-green-tint-10); border-left-color: var(--jm-green); }
.chat-conv-av { position: relative; }
.chat-unread { position: absolute; top: -4px; right: -4px; background: var(--jm-green); color: var(--accent-fg); min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: var(--r-full); border: 2px solid var(--surface-2); font-size: 11px; font-weight: bold; display: flex; align-items: center; justify-content: center; }
.chat-conv-body { flex: 1; min-width: 0; }
.chat-conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chat-conv-name { font-weight: bold; color: var(--fg-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-conv-tag { flex: 0 0 auto; font-size: 9px; font-weight: bold; letter-spacing: .5px; background: var(--jm-green); color: var(--accent-fg); padding: 2px 5px; border-radius: var(--r-sm); }
.chat-conv-time { flex: 0 0 auto; font-size: 11px; color: var(--fg-muted); }
.chat-conv-preview { font-size: 13px; color: var(--fg-4); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-empty-side { padding: 40px 20px; text-align: center; color: var(--fg-muted); font-size: 14px; }

/* thread */
.chat-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.chat-thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.chat-thread-head-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-thread-title { font-weight: bold; color: var(--fg-2); font-size: 17px; }
.chat-thread-sub { font-size: 12px; color: var(--fg-5); margin-top: 2px; }
.chat-thread-members { display: flex; }
.chat-thread-members img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; margin-left: -8px; border: 2px solid var(--bg-subtle); }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 20px; background: var(--content-bg); display: flex; flex-direction: column; gap: 14px; }
.chat-msg { display: flex; gap: 10px; align-items: flex-end; max-width: 72%; }
.chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble-wrap { display: flex; flex-direction: column; min-width: 0; }
.chat-msg-author { font-size: 12px; font-weight: bold; color: var(--fg-4); margin: 0 0 4px 4px; }
.chat-bubble { background: var(--surface); color: var(--fg-2); padding: 10px 14px; border-radius: 14px; border-bottom-left-radius: 4px; box-shadow: var(--sh-card); word-wrap: break-word; max-width: 100%; }
.chat-bubble.mine { background: var(--jm-green); color: var(--accent-fg); border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.chat-msg-text { line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.chat-msg-time { font-size: 11px; opacity: .65; margin-top: 4px; text-align: right; }

/* attachments in bubbles */
.chat-attach-file { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 12px; margin-bottom: 6px; min-width: 200px; text-decoration: none; color: inherit; }
.chat-bubble.mine .chat-attach-file { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); }
.chat-attach-icon { font-size: 24px; flex: 0 0 auto; }
.chat-attach-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-attach-name { font-weight: bold; font-size: 13px; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-bubble:not(.mine) .chat-attach-name { color: var(--fg-2); }
.chat-attach-size { font-size: 11px; opacity: .75; }
.chat-bubble:not(.mine) .chat-attach-size { color: var(--fg-5); }
.chat-attach-dl { flex: 0 0 auto; font-size: 15px; opacity: .85; }
.chat-attach-image { display: block; margin-bottom: 6px; text-decoration: none; color: inherit; }
.chat-attach-image img { display: block; width: 240px; max-width: 100%; height: auto; max-height: 200px; object-fit: cover; border-radius: var(--r-lg); }
.chat-attach-cap { display: block; font-size: 11px; opacity: .8; margin-top: 4px; }

/* pending attachment */
.chat-pending { display: flex; align-items: center; gap: 10px; margin: 0 18px; padding: 10px 12px; background: var(--jm-green-tint-10); border: 1px dashed var(--jm-green); border-radius: var(--r-lg); }
.chat-pending-name { font-weight: bold; color: var(--fg-2); font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pending-x { cursor: pointer; font-size: 20px; color: var(--fg-5); line-height: 1; background: none; border: none; padding: 0; font: inherit; }
.chat-pending-x:hover { color: var(--danger); }
.chat-pending-x:focus-visible { outline: 2px solid var(--phosphor, var(--jm-green)); outline-offset: 2px; }

/* composer */
.chat-composer { display: flex; align-items: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); margin: 0; }
.chat-attach-btn { flex: 0 0 auto; width: 44px; height: 44px; border: 1px solid var(--border); background: var(--surface); border-radius: 50%; font-size: 18px; cursor: pointer; transition: all 0.3s ease; }
.chat-attach-btn:hover { border-color: var(--jm-green); box-shadow: 0 0 0 3px var(--jm-green-tint-10); }
.chat-attach-btn:focus-visible { outline: 2px solid var(--phosphor, var(--jm-green)); outline-offset: 2px; }
.chat-input { flex: 1; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--r-lg); font-size: 14px; font-family: var(--font-sans); resize: none; max-height: 120px; line-height: 1.4; box-sizing: border-box; }
.chat-input:focus { outline: none; border-color: var(--jm-green); box-shadow: 0 0 0 3px var(--jm-green-tint-10); }
.chat-send { flex: 0 0 auto; padding: 12px 24px; }
.chat-no-conv { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--fg-muted); padding: 40px; }

/* group member picker (modal) */
.chat-member-picker { padding: 4px 20px 8px; display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; }
.chat-member-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-lg); cursor: pointer; border: 1px solid transparent; transition: background 0.3s ease; }
.chat-member-row:hover { background: var(--surface-2); }
.chat-member-row.on { background: var(--jm-green-tint-10); border-color: var(--jm-green); }
.chat-member-meta { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-member-name { font-weight: bold; color: var(--fg-2); font-size: 14px; }
.chat-member-role { font-size: 12px; color: var(--fg-5); }
.chat-member-row input { accent-color: var(--jm-green); width: 18px; height: 18px; flex: 0 0 auto; }

@media (max-width: 860px) {
    .chat-shell { grid-template-columns: 1fr; height: auto; }
    .chat-sidebar { max-height: 280px; }
    .chat-thread { min-height: 460px; }
    .chat-msg { max-width: 86%; }
}

/* ---- public folder share page ---- */
.share-folder-list { text-align: left; margin-top: 16px; border-top: 1px solid var(--border-3); }
.share-folder-item { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--border-3); text-decoration: none; color: var(--fg-2); }
.share-folder-item:hover { background: var(--surface-2); }
.share-folder-icon { font-size: 22px; flex: 0 0 auto; }
.share-folder-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.share-folder-name { font-weight: bold; font-size: 14px; word-break: break-word; color: var(--fg-2); }
.share-folder-path { font-size: 12px; color: var(--fg-5); margin-top: 2px; }
.share-folder-size { color: var(--fg-5); font-size: 12px; flex: 0 0 auto; }
.share-folder-dl { flex: 0 0 auto; opacity: .8; }
.share-folder-crumbs { font-size: 13px; color: var(--fg-5); margin: 6px 0 4px; word-break: break-word; }
.share-folder-crumbs a { color: var(--accent-text); font-weight: bold; text-decoration: none; }
.share-folder-crumbs .crumb-sep { color: var(--fg-6, #999); }

/* ================================================================
   APP RELEASES — GitHub-releases-style apps detail
   ================================================================ */
.app-card.is-clickable { cursor: pointer; }
.app-card-releases { margin-top: 12px; color: var(--accent-text); font-weight: var(--fw-bold); font-size: 13px; }
.app-card-releases a { color: var(--accent-text); text-decoration: none; }

.repo-header { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 22px 24px; margin-bottom: 14px; }
.repo-icon { flex: 0 0 auto; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; font-size: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.repo-head-main { flex: 1; min-width: 240px; }
.repo-title { margin: 0 0 6px; font-size: 28px; color: var(--fg-2); font-weight: var(--fw-bold); }
.repo-desc { margin: 0 0 12px; color: var(--fg-4); font-size: 15px; line-height: 1.6; }
.repo-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--fg-5); font-size: 13px; align-items: center; }
.repo-cat { background: var(--jm-green); color: var(--accent-fg); font-weight: var(--fw-bold); padding: 3px 12px; border-radius: var(--r-full); font-size: 12px; }
.repo-head-actions { display: flex; flex-direction: column; gap: 10px; flex: 0 0 auto; }
.repo-head-actions .btn { white-space: nowrap; }
.repo-stats { display: flex; gap: 24px; flex-wrap: wrap; padding: 0 4px 4px; margin-bottom: 4px; color: var(--fg-4); font-size: 14px; }
.repo-stats strong { color: var(--fg-2); }

.releases { margin-top: 24px; }
.release { display: grid; grid-template-columns: 184px 1fr; }
.release-aside { text-align: right; padding: 4px 26px 0 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.release-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-text); font-weight: var(--fw-bold); font-size: 15px; word-break: break-all; }
.release-tag-icon { font-size: 13px; }
.release-date { color: var(--fg-5); font-size: 12px; }
.release-commit { font-family: var(--font-mono); font-size: 11px; color: var(--fg-5); background: var(--surface-2); border: 1px solid var(--border-3); padding: 1px 6px; border-radius: var(--r-sm); }
.release-main { border-left: 2px solid var(--border); padding: 0 0 30px 30px; position: relative; }
.releases .release:last-child .release-main { border-left-color: transparent; }
.release-main::before { content: ""; position: absolute; left: -8px; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--jm-green); border: 3px solid var(--content-bg); box-shadow: 0 0 0 2px var(--border); }
.release-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-card); padding: 22px 24px; transition: box-shadow .3s ease; }
.release-card:hover { box-shadow: var(--sh-hover); }
.release-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.release-title { margin: 0; font-size: 24px; color: var(--fg-2); font-weight: var(--fw-bold); }
.release-latest { background: var(--jm-green); color: var(--accent-fg); padding: 3px 12px; border-radius: var(--r-full); font-size: 12px; font-weight: var(--fw-bold); border: 1px solid var(--jm-green-hover); }
.release-byline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; color: var(--fg-4); font-size: 14px; }
.release-byline img { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--jm-green); object-fit: cover; }
.release-byline strong { color: var(--fg-2); }
.release-cat { margin-left: auto; background: var(--surface-2); color: var(--fg-4); border: 1px solid var(--line); border-radius: var(--r-full); padding: 2px 12px; font-size: 12px; font-weight: var(--fw-bold); }
.release-body { color: var(--fg-3); line-height: 1.65; font-size: 15px; }
.release-body p { margin: 14px 0; }
.release-body h3 { margin: 18px 0 8px; font-size: 16px; color: var(--fg-2); padding-bottom: 6px; border-bottom: 1px solid var(--border-3); }
.release-body ul { margin: 8px 0; padding-left: 22px; }
.release-body li { margin: 5px 0; }
.release-assets { margin-top: 18px; }
.release-assets > summary { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; font-weight: var(--fw-bold); color: var(--fg-2); font-size: 15px; padding: 8px 0; }
.release-assets > summary::-webkit-details-marker { display: none; }
.release-assets-caret { color: var(--fg-5); font-size: 12px; transition: transform .3s ease; }
.release-assets[open] .release-assets-caret { transform: rotate(90deg); }
.release-assets-count { background: var(--bg-cool); color: var(--fg-4); border-radius: var(--r-full); font-size: 12px; padding: 1px 9px; font-weight: var(--fw-bold); }
.asset-list { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-top: 4px; }
.asset-row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border-3); font-size: 14px; transition: background .3s ease; }
.asset-row:last-child { border-bottom: none; }
.asset-row.primary { cursor: pointer; }
.asset-row:hover { background: var(--surface-2); }
.asset-icon { font-size: 18px; line-height: 1; flex: 0 0 auto; }
.asset-name { color: var(--accent-text); font-weight: var(--fw-bold); word-break: break-all; text-decoration: none; }
.asset-row:hover .asset-name { text-decoration: underline; }
.asset-size { margin-left: auto; color: var(--fg-5); font-size: 13px; white-space: nowrap; }
.asset-dl { color: var(--fg-5); font-size: 13px; white-space: nowrap; min-width: 72px; text-align: right; }
.release-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-3); }
.release-meta { color: var(--fg-5); font-size: 13px; }
@media (max-width: 720px) {
  .release { grid-template-columns: 1fr; }
  .release-aside { text-align: left; align-items: flex-start; flex-direction: row; gap: 12px; padding: 0 0 8px 0; flex-wrap: wrap; }
  .release-main { border-left: none; padding-left: 0; }
  .release-main::before { display: none; }
}
/* ---- app cleanup / missing-file flagging ---- */
.cleanup-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap;
    background: var(--warning-bg); border: 1px solid var(--warning-line); color: var(--warning-fg);
    padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-weight: 600;
}
.status-badge.missing-file, .status-missing {
    display: inline-block; background: var(--danger-bg); color: var(--danger-fg);
    border: 1px solid var(--danger-line); border-radius: 12px;
    padding: 2px 10px; font-size: 12px; font-weight: 700; margin-left: 6px;
}
.app-missing-note {
    background: var(--warning-bg); border: 1px solid var(--warning-line); color: var(--warning-fg);
    padding: 8px 12px; border-radius: 8px; margin: 8px 0; font-size: 14px;
}
.app-missing-note a { color: var(--accent-text); font-weight: 700; margin-left: 4px; }
.download-unavailable {
    display: inline-block; background: var(--content-bg); color: #999;
    border: 1px dashed var(--line); border-radius: 6px;
    padding: 8px 14px; font-weight: 600; cursor: not-allowed;
}
.asset-row.asset-missing { cursor: default; opacity: .7; }
.asset-row.asset-missing .asset-size { color: var(--danger-fg); font-weight: 700; }

/* ---- installed-apps tracking (cookie) ---- */
.jm-upd-banner { background:var(--warning-bg); border:1px solid var(--warning-line); color:var(--warning-fg);
    padding:10px 14px; border-radius:8px; margin:12px 0; font-size:15px; }
.jm-upd-banner code { background:var(--warning-bg); padding:1px 6px; border-radius:4px; }
.installed-control { margin-top:8px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.inst-btn { background:var(--accent); color:var(--surface); border:none; border-radius:6px; padding:6px 12px;
    font-weight:600; cursor:pointer; font-size:13px; }
.inst-btn:hover { background:var(--accent-hover); }
.inst-btn.inst-link { background:transparent; color:var(--fg-5); padding:6px 4px; font-weight:500; }
.inst-badge { font-size:13px; font-weight:700; border-radius:10px; padding:3px 10px; }
.inst-badge.inst-ok { color:var(--success-fg); background:var(--success-bg); border:1px solid var(--success-line); }
.inst-badge.inst-upd { color:var(--warning-fg); background:var(--warning-bg); border:1px solid var(--warning-line); }

/* ---- cookie consent ---- */
.cookie-consent { position:fixed; left:0; right:0; bottom:0; z-index:9999;
    background:#1e1e1e; color:var(--border-3); padding:12px 18px; display:flex; gap:14px;
    align-items:center; justify-content:center; flex-wrap:wrap; font-size:14px;
    box-shadow:0 -2px 12px rgba(0,0,0,.2); }
.cookie-consent .cc-text { max-width:760px; }
.cookie-consent .cc-actions { display:flex; gap:8px; }
.cookie-consent .cc-accept { background:var(--accent); color:var(--surface); border:none; border-radius:6px; padding:7px 16px; font-weight:700; cursor:pointer; }
.cookie-consent .cc-accept:hover { background:var(--accent-hover); }
.cookie-consent .cc-decline { background:transparent; color:#bbb; border:1px solid var(--fg-3); border-radius:6px; padding:7px 14px; cursor:pointer; }
.inst-forget { font-size:12px; color:#999; text-decoration:underline; }

/* taller theme list */
.theme-panel-body { max-height: 60vh; overflow-y: auto; }

/* ---- pagination ---------------------------------------------------- */
.jm-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 2rem auto 1rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: .85rem;
}
.jm-pager-btn,
.jm-pager-page {
    display: inline-block;
    padding: .35rem .7rem;
    border: 1px solid var(--border-color, #2a2a2a);
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
    line-height: 1.4;
}
.jm-pager-btn:hover:not(.is-disabled),
.jm-pager-page:hover:not(.is-current) {
    border-color: var(--accent-color, var(--accent));
    color: var(--accent-color, var(--accent));
}
.jm-pager-btn:focus-visible,
.jm-pager-page:focus-visible {
    outline: 2px solid var(--phosphor);
    outline-offset: 2px;
}
.jm-pager-btn.is-disabled { opacity: .35; cursor: default; }
.jm-pager-page.is-current {
    border-color: var(--accent-color, var(--accent));
    background: var(--accent-color, var(--accent));
    color: var(--surface);
}
.jm-pager-pages { display: inline-flex; gap: .3rem; align-items: center; }
.jm-pager-gap { opacity: .5; padding: 0 .2rem; }
.jm-pager-count { opacity: .6; margin-left: .5rem; }
@media (max-width: 600px) {
    .jm-pager-count { width: 100%; text-align: center; margin: .3rem 0 0; }
}

/* ---- grouped navigation ---------------------------------------------
   The menu is absolutely positioned inside a relative .nav-group. Nothing
   here changes overflow or position on <body>, <html> or <header> — doing
   so would break the sticky header (see the note near the header rules). */
.nav-group { position: relative; display: inline-block; }
.nav-group-btn {
    background: none;
    border: none;
    font: inherit;
    /* inherit picks up the page's text colour, not the bar's: a theme with a
       dark nav over a light page painted these black on black */
    color: var(--nav-fg);
    cursor: pointer;
}
/* Colours come from the theme's own surface tokens. These rules used to read
   --card-bg / --border-color / --hover-bg, which no theme defines, so every
   theme got the dark #161b22 fallback — while the links inherited the page's
   dark text: near-black on near-black. --surface / --fg / --line /
   --surface-2 are defined by style.css and by every file in static/themes/. */
.nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    max-width: min(320px, calc(100vw - 16px));
    padding: .35rem;
    background: var(--surface, #ffffff);
    color: var(--fg, #363636);
    border: 1px solid var(--line, #dddddd);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    z-index: 1200;               /* above the sticky header's own stacking */
}
.nav-group.open > .nav-menu { display: block; }
/* Without JavaScript, keyboard focus alone opens the menu. With it, the
   script owns opening (aria-expanded stays truthful, Esc really closes). */
html:not(.js) .nav-group:focus-within > .nav-menu { display: block; }
.nav-menu.flip { left: auto; right: 0; }   /* set by the script near the right edge */
.nav-menu a {
    display: block;
    padding: .55rem .75rem;
    border-radius: 6px;
    color: var(--fg, #363636);
    text-decoration: none;
    white-space: nowrap;
}
.nav-menu a:hover {
    background: var(--surface-2, #f1f3f5);
    color: var(--heading-fg, var(--fg, #0C1512));
}
.nav-menu a:focus { outline: none; }
.nav-menu a:focus-visible {
    background: var(--surface-2, #f1f3f5);
    color: var(--heading-fg, var(--fg, #0C1512));
    outline: 2px solid var(--accent, #0F9D58);
    outline-offset: -2px;
}
.nav-menu a:active { background: var(--line, #dddddd); }
.nav-menu a[aria-current="page"] {
    font-weight: 600;
    color: var(--heading-fg, var(--fg, #0C1512));
    box-shadow: inset 3px 0 0 var(--accent, #0F9D58);
}
/* .dev-link's fixed #ff6b6b (with !important) is ~2.9:1 on a light menu;
   inside the menu keep the readable text colour and mark it with a dot. */
.nav-menu a.dev-link { color: var(--fg, #363636) !important; }
.nav-menu a.dev-link::before { content: "●"; color: #e5484d; margin-right: .45em; font-size: .7em; vertical-align: middle; }
.nav-group-btn[aria-expanded="true"] { color: var(--accent-color, #3ddc84); }
.nav-group-btn:focus-visible { outline: 2px solid var(--accent, #0F9D58); outline-offset: 2px; }

/* Narrow screens: bigger touch targets, and long labels wrap instead of
   pushing the menu off-screen. The script flips a menu to the right edge
   when it would overflow (.flip); width is capped to the viewport. */
@media (max-width: 700px) {
    .nav-menu a { padding: .7rem .8rem; min-height: 44px; box-sizing: border-box; white-space: normal; }
}

/* ---- two-factor ------------------------------------------------------ */
.code-input {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 1.25rem;
    letter-spacing: .25em;
    padding: .6rem .8rem;
    width: 100%;
    max-width: 16rem;
}
.totp-uri { word-break: break-all; white-space: pre-wrap; font-size: .8rem; opacity: .85; }
.totp-secret { font-size: 1.05rem; letter-spacing: .15em; }

/* 2FA setup QR. The light field is not decoration: a scanner expects dark
   modules on light, so the code must not inherit a dark theme's colours. */
.qr-wrap { display: block; width: fit-content; background: var(--surface); padding: .6rem; border-radius: 8px; margin: .6rem 0; }
.qr-wrap .qr { display: block; width: 200px; height: auto; }
.qr-fallback { margin-top: .25rem; }
.qr-fallback summary { cursor: pointer; opacity: .85; }
.qr-fallback[open] summary { margin-bottom: .4rem; }
.backup-codes { list-style: none; padding: 0; columns: 2; }
.backup-codes li { padding: .25rem 0; font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.auth-card, .settings-card {
    max-width: 34rem;
    margin: 2rem auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-card);
    padding: 1.75rem 1.9rem;
}
.auth-card > :first-child, .settings-card > :first-child { margin-top: 0; }
.auth-card > :last-child, .settings-card > :last-child { margin-bottom: 0; }
.settings-card .warn { color: var(--warning-fg); }
.settings-card .ok { color: var(--accent-color, #3ddc84); }

/* =====================================================================
   UNSTYLED-WIDGET BACKFILL
   Classes that templates already reference but that no rule ever matched.
   Grouped by the page family they belong to rather than alphabetically,
   so the next person adding a page can see what its neighbours use.
   ===================================================================== */

/* ---- settings / auth card family (2FA, JM Net, digest, unsubscribe) ---
   These pages postdate the main stylesheet. The site deliberately has no
   bare `button` selector — a global one would repaint every toolbar — so
   their classless <button>s rendered as raw browser controls. Scope the
   button rule to the card instead. */
.auth-card button, .settings-card button {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: var(--fw-bold);
    padding: 10px 20px;
    border: none;
    border-radius: var(--r-md);
    background: var(--jm-green);
    color: var(--accent-fg);
    cursor: pointer;
    transition: background-color .3s ease;
}
.auth-card button:hover, .settings-card button:hover { background: var(--jm-green-hover); color: var(--accent-fg); }
.auth-card button:disabled, .settings-card button:disabled { opacity: .55; cursor: not-allowed; }
.settings-card button.danger { background: var(--danger); color: var(--surface); }
.settings-card button.danger:hover { background: var(--danger-hover); }

/* Secondary text. Used on seven pages and previously inherited body colour,
   so "muted" text was indistinguishable from the copy around it. */
.muted { color: var(--fg-5); font-size: .93em; }
.muted code { font-size: 1em; }

/* ---- JM Net device table ---- */
.net-devices { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .95rem; }
.net-devices th, .net-devices td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border-3); }
.net-devices th {
    font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--fg-5); font-weight: var(--fw-bold);
}
.net-devices tbody tr:last-child td { border-bottom: none; }
.net-devices code { font-size: .9em; white-space: nowrap; }
.net-devices form { margin: 0; }
/* Same specificity as the card button rule above, and later, so it wins. */
.net-devices button { padding: 5px 12px; font-size: 13px; }

/* ---- weekly digest opt-in ---- */
.digest-toggle {
    display: flex; align-items: center; gap: .6rem;
    margin: 1rem 0 1.25rem; cursor: pointer;
    -webkit-user-select: none; -moz-user-select: none; user-select: none;
}
.digest-toggle input { width: 1.05rem; height: 1.05rem; accent-color: var(--jm-green); cursor: pointer; }

/* ---- .btn-feature: the OAuth consent "Allow" and the search submit ----
   Both sit in a flex row next to a taller sibling, so height comes from
   the row's default align-items: stretch rather than a fixed value. */
.btn-feature {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px;
    background: var(--jm-green); color: var(--surface);
    border: none; border-radius: var(--r-md);
    font-family: var(--font-sans); font-size: 15px; font-weight: var(--fw-bold);
    line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .3s ease;
}
.btn-feature:hover { background: var(--jm-green-hover); color: var(--surface); }

/* ---- about page contact block ---- */
.contact-information { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 6px 0 0; }
.contact-information p { margin: 0; color: var(--fg-4); font-size: 14px; }

/* ---- article cards. Scoped: .author/.views/.likes/.comments are names
   generic enough to collide with anything added later. ---- */
.article-card-meta .author { font-weight: var(--fw-bold); color: var(--fg-3); }
.article-card-stats .views,
.article-card-stats .likes,
.article-card-stats .comments { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.article-category { display: flex; align-items: center; flex-shrink: 0; }

/* A form used purely to POST a button inside a flex action row. */
.inline-form { display: inline-flex; margin: 0; }

/* ---- API / CLI docs section. scroll-margin matters: the header is
   sticky, and these sections are #anchor targets. ---- */
.api-group { margin: 0 0 34px; scroll-margin-top: 90px; }

/* ---- admin list wrappers. The cards carry their own margin-bottom;
   move the spacing onto the container so the wrapper owns the layout. ---- */
.apps-table, .users-table { display: flex; flex-direction: column; gap: 20px; }
.apps-table > .app-management-card,
.users-table > .user-management-card { margin-bottom: 0; }

/* =====================================================================
   ARTICLES
   The band is fixed brand ink; everything below it uses the surface
   tokens, so an article reads correctly in all twelve themes. The old
   .articles-* rules above are superseded by these and go once nothing
   references them.
   ===================================================================== */

/* ---- the band ---- */
.ja-band {
  background:
    radial-gradient(120% 90% at 88% 0%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, color-mix(in srgb, var(--accent) 0%, transparent) 55%),
    var(--ink);
  color: var(--ink-fg);
  padding: clamp(44px, 7vh, 76px) 0 clamp(26px, 4vh, 40px);
  border-bottom: 1px solid var(--ink-line);
}
/* Without this the wrap's 24px padding adds to its 100% width and the page
   scrolls sideways by 48px — the list runs out past the viewport and the
   right-hand stats get clipped. The projects design sets the same rule for
   its own scope. */
.jm-articles *, .jm-articles *::before, .jm-articles *::after { box-sizing: border-box; }
.ja-wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; width: 100%; }
.ja-eyebrow {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--phosphor); margin: 0 0 12px; font-weight: 500;
}
.ja-title {
  font-family: var(--mono); font-weight: 500; letter-spacing: -0.01em;
  font-size: clamp(28px, 4.2vw, 44px); line-height: 1.05; margin: 0 0 10px; color: #F3FBF6;
}
.ja-title .ja-prompt { color: var(--phosphor); }
.ja-sub { font-size: 16px; color: var(--ink-fg-dim); margin: 0 0 24px; max-width: 58ch; }

/* ---- search, on the band ---- */
.ja-search { margin: 0 0 16px; }
.ja-field {
  display: flex; align-items: center; background: #061009;
  border: 1px solid var(--ink-line); border-radius: 12px; overflow: hidden; max-width: 620px;
}
.ja-field:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.ja-field-prompt { font-family: var(--mono); color: var(--phosphor); padding: 0 6px 0 16px; font-weight: 600; flex: none; }
.ja-input {
  flex: 1 1 auto; min-width: 0; background: transparent; border: 0; outline: none;
  font-family: var(--mono); font-size: 14px; color: var(--ink-fg); padding: 13px 10px;
}
.ja-input::placeholder { color: #5E7A6C; opacity: 1; }
.ja-go {
  flex: none; background: var(--phosphor); color: #04120A; border: 0;
  font-family: var(--font-sans); font-weight: 600; font-size: 14px;
  padding: 0 20px; align-self: stretch; cursor: pointer; transition: background .18s ease;
}
.ja-go:hover { background: var(--phosphor-deep); }

/* ---- category chips ---- */
.ja-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ja-chip {
  font-family: var(--mono); font-size: 12.5px; text-decoration: none; color: var(--ink-fg-dim);
  border: 1px solid var(--ink-line); background: color-mix(in srgb, var(--accent) 4%, transparent);
  padding: 5px 13px; border-radius: 999px;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.ja-chip:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--ink-fg); }
.ja-chip:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; }
.ja-chip-on { color: #04120A; background: var(--phosphor); border-color: var(--phosphor); font-weight: 600; }
.ja-band-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; }
.ja-btn {
  font-family: var(--font-sans); font-weight: 600; font-size: 13.5px; text-decoration: none;
  padding: 9px 16px; border-radius: 9px; background: var(--phosphor); color: #04120A;
  border: 1.5px solid transparent; transition: transform .18s ease;
}
.ja-btn:hover { transform: translateY(-2px); }
.ja-btn-ghost { background: transparent; color: var(--phosphor); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.ja-btn-ghost:hover { border-color: var(--phosphor); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ja-copy-link { cursor: pointer; font: inherit; }
.ja-copy-link.is-copied { border-color: var(--phosphor); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ja-print { cursor: pointer; font: inherit; }
.ja-cite { cursor: pointer; font: inherit; }
.ja-cite.is-copied { border-color: var(--phosphor); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ja-email { cursor: pointer; font: inherit; }
.ja-rss { cursor: pointer; font: inherit; }
.jr-rss { cursor: pointer; font: inherit; }
.jr-print { cursor: pointer; font: inherit; }
.jr-share { cursor: pointer; font: inherit; }
.jr-email { cursor: pointer; font: inherit; }
.ja-atom { cursor: pointer; font: inherit; }
/* Off-site links in an article body (marked server-side by
   mark_external_links): a small decorative arrow after the text. */
.ja-ext-link::after {
  content: "\2197";
  content: "\2197" / "";   /* empty alt text: decorative, not announced */
  display: inline-block;
  margin-left: 0.15em;
  font-size: 0.8em;
  opacity: 0.6;
  text-decoration: none;
}
.ja-copy-link-status {
  font-family: var(--mono); font-size: 12px; color: var(--accent-text);
  align-self: center; min-width: 4.5em;
}
@media (prefers-reduced-motion: reduce) {
  .ja-copy-link { transition: none; }
  .ja-cite { transition: none; }
}
/* Floating back-to-top on article/project detail (shown after ~500px scroll). */
.ja-back-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 900;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--phosphor);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease,
              border-color .18s ease, background .18s ease;
}
.ja-back-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}
.ja-back-top:hover {
  border-color: var(--phosphor);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.ja-back-top:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .ja-back-top { transition: none; transform: none; }
}
/* Thin reading-progress bar along the top edge of article detail. */
.ja-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 1001;
  pointer-events: none;
  background: var(--phosphor);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 45%, transparent);
  opacity: 0;
  transition: opacity .18s ease;
}
.ja-read-progress.is-active {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .ja-read-progress { transition: none; }
}
/* One-click Copy on article code blocks (pre / pre>code). */
.ja-code-wrap {
  position: relative;
}
.ja-code-wrap > pre {
  /* leave room so the overlay button does not cover the first lines */
  padding-top: 42px;
}
.ja-copy-code {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--phosphor);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.ja-copy-code:hover {
  border-color: var(--phosphor);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.ja-copy-code:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 2px;
}
.ja-copy-code.is-copied {
  border-color: var(--phosphor);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.ja-copy-code svg {
  flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) {
  .ja-copy-code { transition: none; }
}

/* Collapse long article code blocks behind Show more / Show less. */
.ja-code-wrap.is-collapsible {
  margin-bottom: 0.35rem;
}
.ja-code-wrap.is-collapsed > pre {
  max-height: 14.5em; /* ~12 lines of mono */
  overflow: hidden;
}
.ja-code-wrap.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2.6rem; /* sit above the expand control */
  height: 3.2em;
  pointer-events: none;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--surface) 0%, transparent),
    color-mix(in srgb, var(--surface) 92%, transparent));
}
.ja-code-expand {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
  padding: 8px 12px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  color: var(--phosphor);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.ja-code-wrap.is-collapsible > pre {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
}
.ja-code-expand:hover {
  border-color: var(--phosphor);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.ja-code-expand:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .ja-code-expand { transition: none; }
}

/* Heading permalink (#) beside article h2/h3 with stable ids. */
.ja-heading-anchor {
  margin-left: 0.35em;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75em;
  line-height: 1;
  text-decoration: none;
  color: var(--phosphor);
  opacity: 0;
  vertical-align: middle;
  transition: opacity .18s ease;
}
.article-detail-content h2:hover > .ja-heading-anchor,
.article-detail-content h3:hover > .ja-heading-anchor,
.article-detail-content h2:focus-within > .ja-heading-anchor,
.article-detail-content h3:focus-within > .ja-heading-anchor,
.ja-heading-anchor:focus-visible,
.ja-heading-anchor.is-copied {
  opacity: 0.85;
}
.ja-heading-anchor:hover {
  opacity: 1;
  text-decoration: underline;
}
.ja-heading-anchor:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 2px;
  border-radius: 3px;
}
.ja-heading-anchor.is-copied {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .ja-heading-anchor { transition: none; }
}

/* Auto table of contents on article detail (h2/h3, ≥2 headings). */
.ja-toc {
  max-width: 70ch;
  margin: 0 0 28px;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.ja-toc-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 10px;
}
.ja-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ja-toc-item a {
  display: block;
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--phosphor);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: background .15s ease, border-color .15s ease;
}
.ja-toc-item a:hover {
  background: var(--surface-2);
  border-left-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.ja-toc-item a:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 2px;
}
.ja-toc-h3 a {
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--fg);
}
/* Scroll-spy: the section currently being read. */
.ja-toc-item a[aria-current="location"] {
  background: var(--surface-2);
  border-left-color: var(--accent);
  font-weight: 600;
}
.ja-post .article-detail-content h2:target,
.ja-post .article-detail-content h3:target {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 4px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .ja-toc-item a { transition: none; }
}

/* Article detail breadcrumb: Home › Articles › title (current). */
.ja-breadcrumb {
  margin: 0 0 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-fg-dim);
}
.ja-breadcrumb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
.ja-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}
.ja-breadcrumb-item + .ja-breadcrumb-item::before {
  content: "›";
  display: inline-block;
  margin: 0 8px;
  color: var(--ink-fg-faint, var(--fg-5));
  font-weight: 400;
  speak: never;
}
.ja-breadcrumb-item a {
  color: var(--phosphor);
  text-decoration: none;
}
.ja-breadcrumb-item a:hover {
  text-decoration: underline;
}
.ja-breadcrumb-item a:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 2px;
  border-radius: 4px;
}
.ja-breadcrumb-current {
  color: var(--ink-fg);
  font-weight: 600;
  min-width: 0;
}
.ja-breadcrumb-current-text {
  display: inline-block;
  max-width: min(42ch, 70vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.ja-sorts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 14px 0 0; font-family: var(--mono); font-size: 13px; }
.ja-sorts-label { color: var(--ink-fg-faint); }
.ja-sort { color: var(--ink-fg-dim); text-decoration: none; border-bottom: 1px solid transparent; padding: 1px 0; }
.ja-sort:hover { color: var(--phosphor); border-bottom-color: currentColor; }
.ja-sort:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; border-radius: 2px; }
.ja-sort.ja-sort-on { color: var(--phosphor); font-weight: 600; border-bottom-color: currentColor; }
.ja-note { font-family: var(--mono); font-size: 13px; color: var(--ink-fg-faint); margin: 16px 0 0; }
.ja-note a { color: var(--phosphor); text-decoration: none; }
.ja-note a:hover { text-decoration: underline; }

/* ---- the list. Themed surfaces from here down. ---- */
.ja-body { background: var(--page-bg); padding: clamp(26px, 4vh, 44px) 0 clamp(50px, 8vh, 84px); }
.ja-count { font-family: var(--mono); font-size: 13px; color: var(--fg-muted); margin: 0 0 14px; }
.ja-count .ja-prompt { color: var(--accent-text); }
.ja-list {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface);
}
.ja-item { display: flex; gap: 20px; padding: 18px 22px; border-top: 1px solid var(--line); transition: background .15s ease; }
.ja-item:first-child { border-top: 0; }
.ja-item:hover { background: var(--surface-2); }
.ja-item-main { flex: 1 1 auto; min-width: 0; }
.ja-item-title {
  font-family: var(--display); font-weight: 600; font-size: 17.5px; letter-spacing: -0.01em;
  text-decoration: none; color: var(--heading-fg); display: inline-block; margin: 0 0 5px;
}
.ja-item:hover .ja-item-title { color: var(--accent-text); }
.ja-summary {
  margin: 0 0 9px; font-size: 14.5px; line-height: 1.55; color: var(--fg-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ja-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-family: var(--mono); font-size: 12px; color: var(--fg-muted); }
.ja-author { font-weight: 600; color: var(--fg); }
.ja-cat {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .02em;
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: 3px 9px; border-radius: 999px; text-decoration: none;
}
.ja-cat:hover { border-color: var(--accent); }
.ja-tag { font-family: var(--mono); font-size: 11.5px; color: var(--fg-muted); text-decoration: none; }
.ja-tag::before { content: '#'; opacity: .55; }
a.ja-tag:hover { color: var(--accent-text); }
.ja-tag-on { color: var(--accent-text); }
.ja-item-side {
  flex: none; width: 118px; text-align: right;
  font-family: var(--mono); font-size: 12px; color: var(--fg-muted);
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.ja-item-side .ja-copy-link {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--accent-text); background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 8px; padding: 5px 10px; cursor: pointer; letter-spacing: .01em;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ja-item-side .ja-copy-link:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.ja-item-side .ja-copy-link:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; }
.ja-item-side .ja-copy-link.is-copied { border-color: var(--phosphor-deep); color: var(--accent-text); }
@media (prefers-reduced-motion: reduce) {
  .ja-item-side .ja-copy-link { transition: none; }
}
.ja-stat { display: block; line-height: 1.7; white-space: nowrap; }
.ja-draft {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: #8A6100;
  background: rgba(232,179,65,.14); border: 1px solid rgba(232,179,65,.4);
  padding: 3px 9px; border-radius: 999px;
}
.ja-empty {
  text-align: center; padding: 60px 24px; border: 1px dashed var(--line);
  border-radius: 14px; background: var(--surface);
}
.ja-empty-lead { font-family: var(--display); font-weight: 600; font-size: 19px; margin: 0 0 8px; color: var(--heading-fg); }
.ja-empty-sub { font-size: 14.5px; color: var(--fg-muted); margin: 0; }
.ja-empty a { color: var(--accent-text); }
.ja-empty-next { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.ja-empty-next a:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; border-radius: 2px; }

@media (max-width: 720px) {
  .ja-item { flex-direction: column; gap: 10px; }
  .ja-item-side {
    width: 100%; text-align: left;
    display: flex; flex-direction: row; flex-wrap: wrap;
    align-items: center; gap: 14px;
  }
  .ja-item-side .ja-copy-link { order: -1; }
  .ja-field { max-width: 100%; }
}

/* ---- a single article ---- */
.ja-post-title {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(26px, 4vw, 40px); line-height: 1.12; margin: 0 0 14px; color: #F3FBF6;
  max-width: 24ch;
}
.ja-post-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-fg-dim);
}
.ja-post-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid var(--ink-line); }
.ja-post-author { font-weight: 600; color: var(--ink-fg); }
.ja-post-dot { color: var(--ink-fg-faint); }
.ja-post-updated { color: var(--ink-fg-dim); }
a.ja-post-comments {
  color: inherit; text-decoration: none; border-bottom: 1px dotted color-mix(in srgb, var(--ink-fg-dim) 55%, transparent);
}
a.ja-post-comments:hover,
a.ja-post-comments:focus-visible {
  color: var(--accent-text); border-bottom-color: var(--accent);
  outline: none;
}
.ja-post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.ja-tag-ink {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-fg-dim);
  border: 1px solid var(--ink-line); background: color-mix(in srgb, var(--accent) 4%, transparent);
  padding: 3px 10px; border-radius: 999px; text-decoration: none;
}
.ja-tag-ink::before { content: '#'; color: var(--phosphor); opacity: .8; }
a.ja-tag-ink:hover { border-color: var(--accent); color: var(--accent-text); }

/* The reading column. A measure this wide is the single biggest thing
   separating a page you read from a page you skim off. */
.ja-post .article-detail { background: none; border: 0; padding: 0; margin: 0; box-shadow: none; }
.ja-post .article-detail-content {
  max-width: 70ch; font-size: 17px; line-height: 1.75; color: var(--fg);
}
.ja-post .article-detail-content > * + * { margin-top: 1.1em; }
.ja-post .article-detail-content h2,
.ja-post .article-detail-content h3 {
  font-family: var(--display); color: var(--heading-fg); letter-spacing: -0.01em;
  margin-top: 1.8em; margin-bottom: .5em;
  position: relative;
  /* sticky header covers ~70–90px; TOC / heading permalinks land under it
     without this (same pattern as .api-group / .upd-entry / .rm-item). */
  scroll-margin-top: 90px;
}
.ja-post .article-detail-content img { max-width: 100%; height: auto; border-radius: 10px; }
.ja-post .article-detail-content pre {
  background: var(--code-bg); color: var(--code-fg); padding: 14px 16px;
  border-radius: 10px; overflow: auto; font-size: 13.5px; line-height: 1.6;
}
.ja-post .article-detail-content blockquote {
  margin-left: 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--phosphor-deep);
  color: var(--fg-muted);
}
/* Markdown from JJ Bot (Share -> Publish on jmtechpower.com) and the API:
   inline code, tables (wide ones scroll sideways on a phone) and task lists. */
.ja-post .article-detail-content :not(pre) > code {
  font-family: var(--mono); font-size: .88em; padding: .1em .38em;
  border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2);
}
.ja-post .article-detail-content .tablescroll { overflow-x: auto; }
.ja-post .article-detail-content table {
  display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; line-height: 1.5;
}
.ja-post .article-detail-content th,
.ja-post .article-detail-content td { border: 1px solid var(--line); padding: 7px 12px; vertical-align: top; }
.ja-post .article-detail-content thead th { background: var(--surface-2); font-weight: 600; }
.ja-post .article-detail-content li.task { list-style: none; margin-left: -1.25em; }
/* JM Drive files shown in place (drive_media.py): picture, player or PDF, with its link below */
.ja-post .article-detail-content .drive-embed { display: block; margin: 1em 0; }
.ja-post .article-detail-content .drive-embed img,
.ja-post .article-detail-content .drive-embed video { display: block; max-width: 100%; height: auto; border-radius: 10px; }
.ja-post .article-detail-content .drive-embed audio { display: block; width: 100%; max-width: 520px; }
.ja-post .article-detail-content .drive-embed iframe { display: block; width: 100%; height: 70vh; min-height: 360px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ja-post .article-detail-content .drive-embed-cap { display: block; margin-top: 6px; font-size: 13px; color: var(--fg-muted); }
.ja-post .article-detail-content video, .ja-post .article-detail-content audio { max-width: 100%; }
.ja-post .article-detail-actions {
  display: flex; gap: 10px; max-width: 70ch;
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line);
}

/* ---- like ---- */
.ja-post .article-like-section { max-width: 70ch; margin: 24px 0 0; text-align: left; }
.ja-post .btn-like {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--mono); font-size: 13.5px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  text-decoration: none; transition: border-color .18s ease, background .18s ease;
}
.ja-post .btn-like:hover { border-color: var(--accent); background: var(--surface-2); }
.ja-post .btn-like.liked { border-color: var(--accent); color: var(--accent-text); }
.ja-post .like-count { font-variant-numeric: tabular-nums; color: var(--fg-muted); }
.ja-post .like-login-hint { font-size: 12.5px; color: var(--fg-muted); margin: 8px 0 0; }

/* ---- comments ---- */
.ja-post .article-comments-section { max-width: 70ch; margin: 36px 0 0; scroll-margin-top: 90px; /* #comments jump clears sticky header */ }
.ja-post .article-comments-section > h2 {
  font-family: var(--display); font-size: 19px; color: var(--heading-fg);
  margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.ja-post .article-comment-item,
.ja-post .article-reply-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin: 0 0 12px;
}
.ja-post .article-reply-item { margin-left: 22px; background: var(--surface-2); }
.ja-post .article-comment-header,
.ja-post .article-reply-header { display: flex; align-items: center; gap: 9px; margin: 0 0 8px; }
.ja-post .article-comment-avatar,
.ja-post .article-reply-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.ja-post .article-comment-author,
.ja-post .article-reply-author { font-weight: 600; font-size: 14px; color: var(--heading-fg); }
.ja-post .article-comment-date,
.ja-post .article-reply-date { font-family: var(--mono); font-size: 11.5px; color: var(--fg-muted); margin-left: auto; }
.ja-post .article-comment-content,
.ja-post .article-reply-content { font-size: 14.5px; line-height: 1.6; color: var(--fg); margin: 0; }
.ja-post .article-comment-textarea,
.ja-post .article-reply-textarea {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 14.5px;
  padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--input-bg); color: var(--fg); resize: vertical;
}
.ja-post .article-comment-textarea:focus,
.ja-post .article-reply-textarea:focus { outline: none; border-color: var(--accent); }
.ja-post .article-btn-reply, .ja-post .article-btn-delete {
  font-family: var(--mono); font-size: 12px; cursor: pointer; padding: 5px 11px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg-muted);
}
.ja-post .article-btn-reply:hover { border-color: var(--accent); color: var(--accent-text); }
.ja-post .article-btn-delete:hover { border-color: var(--danger-fg); color: var(--danger-fg); }
.ja-post .article-comment-actions, .ja-post .article-reply-actions { display: flex; gap: 8px; margin-top: 10px; }
.ja-post .article-no-comments, .ja-post .article-login-prompt {
  font-size: 14px; color: var(--fg-muted); padding: 16px; text-align: center;
  border: 1px dashed var(--line); border-radius: 12px;
}
/* Plain links only. A .btn in here already carries its own text colour,
   and recolouring it paints green text on a green button. */
.ja-post .article-login-prompt a:not(.btn):not([class*='btn']) { color: var(--accent-text); }

/* ---- writing: the create / edit forms, and the editor toolbar ---- */
.jm-articles .article-form-container { max-width: 880px; margin: 0 auto; padding: 0 24px; }
.jm-articles .article-form-page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 0 0 20px;
}
.jm-articles .article-form-page-header h1 {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(22px, 3vw, 30px); margin: 0; color: var(--heading-fg);
}
.jm-articles .article-form {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px; box-shadow: var(--sh-card);
}
.jm-articles .article-form-group { margin: 0 0 20px; }
.jm-articles .article-form-group > label {
  display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--fg-muted); margin: 0 0 7px; font-weight: 600;
}
.jm-articles .article-form-required { color: var(--danger-fg); }
.jm-articles .article-form-control {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 15px;
  padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--input-bg); color: var(--fg); transition: border-color .18s ease;
}
.jm-articles .article-form-control:focus { outline: none; border-color: var(--accent); }
.jm-articles textarea.article-form-control { resize: vertical; line-height: 1.6; }
.jm-articles .article-form-text { font-size: 12.5px; color: var(--fg-muted); margin: 6px 0 0; }
.jm-articles .article-form-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line);
}

/* The rich-text toolbar. Moved out of the page's own <style> so it follows
   the theme like everything else; the editor's JavaScript is untouched. */
.jm-articles .rich-editor-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 8px; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 10px 10px 0 0; background: var(--surface-2);
}
.jm-articles .toolbar-group { display: flex; gap: 2px; }
.jm-articles .toolbar-separator { width: 1px; align-self: stretch; background: var(--line); margin: 2px 6px; }
.jm-articles .toolbar-btn {
  min-width: 30px; height: 30px; padding: 0 8px; cursor: pointer;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--fg); font-size: 14px; line-height: 1;
  transition: background .15s ease, border-color .15s ease;
}
.jm-articles .toolbar-btn:hover { background: var(--surface); border-color: var(--line); }
.jm-articles .toolbar-btn.active { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.jm-articles .toolbar-select {
  height: 30px; font-family: inherit; font-size: 13px; padding: 0 6px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--input-bg); color: var(--fg);
}
.jm-articles .rich-editor-toolbar + .article-form-control,
.jm-articles .rich-editor-toolbar + * .article-content-textarea {
  border-radius: 0 0 10px 10px;
}
.jm-articles .article-content-textarea {
  width: 100%; box-sizing: border-box; min-height: 320px; font-family: inherit;
  font-size: 15px; line-height: 1.7; padding: 14px; border: 1px solid var(--line);
  background: var(--input-bg); color: var(--fg);
}
.jm-articles .article-content-textarea:focus { outline: none; border-color: var(--accent); }

/* preview modal */
.jm-articles .article-preview-modal-content {
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: 14px;
}
.jm-articles .article-preview-modal-header,
.jm-articles .article-preview-modal-footer { border-color: var(--line); }

/* The contenteditable the toolbar drives. These used to live in
   create_article.html's own <style>, which loaded after style.css and so
   kept the editing surface white in every dark theme. The JavaScript that
   drives it is untouched. */
.jm-articles .rich-editor {
  min-height: 400px; padding: 14px; font-size: 15px; line-height: 1.7;
  border: 1px solid var(--line); border-radius: 0 0 10px 10px;
  background: var(--input-bg); color: var(--fg); overflow-y: auto;
}
.jm-articles .rich-editor:focus { outline: none; border-color: var(--accent); }
.jm-articles .rich-editor:empty:before {
  content: attr(placeholder); color: var(--fg-muted); pointer-events: none;
}
.jm-articles .rich-editor img { max-width: 100%; height: auto; border-radius: 8px; }
.jm-articles .rich-editor pre {
  background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; overflow: auto;
}
.jm-articles .rich-editor code {
  background: var(--surface-2); padding: 2px 6px; border-radius: 4px;
  font-family: var(--font-mono); font-size: .92em;
}
.jm-articles .rich-editor pre code { background: none; padding: 0; color: inherit; }
.hidden { display: none !important; }

/* =====================================================================
   DRIVE + CHAT polish
   ===================================================================== */

/* A file row offers up to eight actions. As bare links they ran together
   into a paragraph of green text; as chips they wrap into a tidy block and
   you can tell where one ends and the next begins. */
.drive-cell.actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.drive-action {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; line-height: 1;
  padding: 5px 9px; border-radius: 7px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg-muted);
  text-decoration: none; transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.drive-action:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-2); }
.drive-action.danger { color: var(--fg-muted); }
.drive-action.danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(179,38,30,.06); }

.drive-row { transition: background .15s ease; }
.drive-row:hover { background: var(--surface-2); }
.drive-head { font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--fg-muted); }
.drive-vis {
  font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--fg-muted); white-space: nowrap;
}
.drive-vis.is-public { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.drive-tab { font-family: var(--mono); font-size: 13px; }
.drive-cell.size, .drive-cell.date { font-family: var(--mono); font-size: 12px; color: var(--fg-muted); }

/* Chat: the shell, so a conversation reads as one surface rather than
   three boxes that happen to be next to each other. */
.chat-shell { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.chat-sidebar { background: var(--surface-2); border-right: 1px solid var(--line); }
.chat-conv { border-bottom: 1px solid var(--line); transition: background .15s ease; }
.chat-conv:hover { background: var(--surface); }
.chat-conv-time { font-family: var(--mono); font-size: 11px; }
.chat-composer { border-top: 1px solid var(--line); background: var(--surface); }
.chat-bubble { border-radius: 14px; }
.chat-bubble.mine { background: var(--accent); }
.chat-msg-time { font-family: var(--mono); font-size: 10.5px; opacity: .75; }


/* =====================================================================
   AUTH & ACCOUNT SHELL
   Sign in, register, profile, tokens, 2FA, digest and the OAuth / CLI
   consent screens. They used to be a 400px form adrift in a full-width
   .page-content box, each page inventing its own heading size. One card
   shell now carries all of them, so a new account page needs no CSS.
   ===================================================================== */
.auth-card, .settings-card { max-width: 34rem; }
.auth-card.auth-wide, .settings-card.auth-wide { max-width: 52rem; }

/* the shell supplies the width, so the form inside must not re-centre */
.auth-card .auth-form,
.auth-card .profile-form,
.settings-card .auth-form,
.settings-card .profile-form { max-width: none; margin: 0; padding: 0; }

.auth-eyebrow {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--fg-muted);
    margin: 0 0 .35rem;
}
.auth-card h1, .settings-card h1,
.auth-card h2, .settings-card h2 {
    font-size: 1.5rem;
    line-height: 1.2;
    margin: 0 0 .4rem;
    color: var(--heading-fg);
}
.auth-sub {
    color: var(--fg-muted);
    font-size: .95rem;
    margin: 0 0 1.4rem;
}

/* A label and its field read as one unit; the old bold-black label on a
   dark theme was the loudest thing on the page. */
.auth-card .form-group label,
.settings-card .form-group label {
    font-weight: 600;
    font-size: .88rem;
    color: var(--fg-muted);
    letter-spacing: .01em;
}
.auth-card .form-group input,
.auth-card .form-group textarea,
.auth-card .form-group select,
.settings-card .form-group input,
.settings-card .form-group textarea,
.settings-card .form-group select,
.auth-card .code-input, .settings-card .code-input {
    background: var(--input-bg);
    color: var(--fg);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-card :is(input, textarea, select):focus-visible,
.settings-card :is(input, textarea, select):focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.auth-card .form-group, .settings-card .form-group { margin-bottom: 1.1rem; }

/* Buttons. The card already scopes a bare <button>; these make the named
   ones match it instead of each being its own shade of green. */
.auth-card .auth-button, .auth-card .save-button,
.settings-card .auth-button, .settings-card .save-button { border-radius: var(--r-md); }
.auth-card .cancel-button, .settings-card .cancel-button {
    background: transparent;
    color: var(--fg-muted);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}
.auth-card .cancel-button:hover, .settings-card .cancel-button:hover {
    background: var(--surface-2);
    color: var(--fg);
    border-color: var(--fg-muted);
}
.auth-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* Sign-in-with buttons: the brand glyphs stay their own colours, the
   chrome around them follows the theme. */
.auth-card .btn-social, .settings-card .btn-social {
    background: var(--surface-2);
    color: var(--fg);
    border-radius: var(--r-md);
}
.auth-card .btn-social:hover, .settings-card .btn-social:hover { color: var(--fg); }
.auth-card .btn-social svg path[fill="#181717"] {
    /* GitHub's mark is near-black and vanished on the dark themes */
    fill: var(--fg);
}
.auth-card .social-divider, .settings-card .social-divider { color: var(--fg-muted); }

.auth-card .auth-link, .settings-card .auth-link {
    margin: 1.2rem 0 0;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
    font-size: .93rem;
    color: var(--fg-muted);
}
.auth-card .auth-link a { color: var(--link); }

/* Register's "send code" pairing. The input and its button were separate
   heights, so the row never lined up. */
.auth-card .verification-group { display: flex; gap: .5rem; align-items: stretch; }
.auth-card .verification-group input { flex: 1; min-width: 0; }
.auth-card .send-code-btn { white-space: nowrap; border-radius: var(--r-md); }
.auth-card .form-help, .settings-card .form-help { color: var(--fg-muted); }

/* ---- API tokens page -------------------------------------------------
   Was an inline <style> on the template, which loaded after this file and
   so pinned the page light whatever theme was picked. */
.tokens-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tokens-header h1 { margin: 0; }
.tokens-doc-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.api-docs-btn { white-space: nowrap; }
.token-google-note {
    background: var(--info-bg); border: 1px solid var(--info-line); color: var(--info-fg);
    border-radius: var(--r-md); padding: 10px 12px; font-size: 14px;
}
.token-reveal {
    background: var(--success-bg); border: 2px solid var(--accent);
    border-radius: 10px; padding: 14px; margin: 14px 0; color: var(--success-fg);
}
.token-value {
    width: 100%; box-sizing: border-box; font-family: var(--mono, 'IBM Plex Mono', ui-monospace, monospace);
    padding: 8px; margin-top: 6px; border: 1px solid var(--accent);
    border-radius: 6px; background: var(--input-bg); color: var(--fg);
}
.token-hint { font-size: 13px; color: var(--fg-muted); margin: 8px 0 0; }
.token-create-card {
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 10px; padding: 14px; margin: 14px 0;
}
.token-create-form { display: flex; gap: 10px; flex-wrap: wrap; }
.token-name-input {
    flex: 1; min-width: 200px; padding: 8px; border: 1px solid var(--line);
    border-radius: 6px; background: var(--input-bg); color: var(--fg);
}
.token-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.token-table th, .token-table td {
    text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.token-table th { color: var(--fg-muted); font-size: .85rem; letter-spacing: .02em; }
.token-install { margin-top: 24px; }
/* The terminal strip keeps its own dark field in every theme: a light theme
   turning a shell transcript grey-on-white reads as broken, not themed. */
.token-pre, pre.token-pre {
    background: #1e1e1e; color: #e6e6e6; padding: 14px; border-radius: 8px;
    overflow: auto; font-family: var(--mono, 'IBM Plex Mono', ui-monospace, monospace);
}

/* ---- CLI / OAuth consent screens ------------------------------------
   Both are the same shape: one centred card, an identity line, a scope
   list and an allow/deny pair. */
.authorize-card {
    max-width: 520px; margin: 40px auto; background: var(--surface);
    border: 1px solid var(--line); border-radius: 14px; padding: 28px;
    text-align: center; box-shadow: var(--sh-card);
}
.authorize-card h1 { font-size: 22px; margin: 0 0 .5rem; }
.authorize-device {
    display: inline-flex; align-items: center; gap: 10px; background: var(--surface-2);
    border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px;
    margin: 12px 0; font-size: 18px;
}
.authorize-device-icon { font-size: 22px; }
.authorize-as { color: var(--fg-muted); }
.authorize-warn {
    color: var(--warning-fg); background: var(--warning-bg);
    border: 1px solid var(--warning-line); border-radius: 8px;
    padding: 10px 12px; font-size: 14px;
}
.authorize-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }
.authorize-approve {
    flex: 1; background: var(--accent); color: var(--accent-fg); border: none;
    border-radius: 8px; padding: 12px 28px; font-size: 16px; font-weight: 700; cursor: pointer;
    transition: background-color .2s ease;
}
.authorize-approve:hover { background: var(--accent-hover); }
.authorize-deny {
    flex: 1; background: transparent; color: var(--fg-muted); border: 1px solid var(--line);
    border-radius: 8px; padding: 12px 22px; font-size: 15px; cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}
.authorize-deny:hover { background: var(--surface-2); color: var(--fg); }
.authorize-brand { color: var(--accent-text); }
.authorize-who { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0; }
.authorize-who img { border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.authorize-who-text { text-align: left; }
.authorize-email { font-size: 12px; color: var(--fg-muted); }
.authorize-scopes {
    text-align: left; background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 10px; padding: 14px; margin: 12px 0;
}
.authorize-scopes ul { margin: 0; padding-left: 20px; }
.authorize-scopes li { margin: 4px 0; }
.authorize-redirect { font-size: 12px; color: var(--fg-muted); margin-top: 14px; word-break: break-all; }

/* =====================================================================
   ADMIN PANELS  (.adm-*)
   /dev_roadmap and /dev_updates each carried a near-identical 100-line
   inline <style>, which loaded after this file and so pinned both pages
   light. One component here, with both status- and kind- variants, and a
   new admin page gets the look for free.
   ===================================================================== */
.adm-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 22px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .05);
}
.adm-panel > h2 {
    font-family: var(--display, 'Space Grotesk', 'IBM Plex Sans', Arial, sans-serif);
    font-size: 18px; font-weight: 700; color: var(--heading-fg);
    margin: 0 0 4px;
}
.adm-panel > p.adm-hint {
    font-family: 'IBM Plex Sans', Arial, sans-serif;
    font-size: 13px; color: var(--fg-muted); margin: 0 0 16px;
}
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.adm-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.adm-field.wide { grid-column: 1 / -1; }
.adm-field label {
    font-family: var(--mono, 'IBM Plex Mono', ui-monospace, monospace);
    font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--fg-muted);
}
.adm-field input, .adm-field textarea, .adm-field select {
    width: 100%; box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid var(--line); border-radius: 6px;
    font-family: 'IBM Plex Sans', Arial, sans-serif; font-size: 14px;
    background: var(--input-bg); color: var(--fg);
}
.adm-field textarea {
    min-height: 92px; resize: vertical;
    font-family: var(--mono, 'IBM Plex Mono', ui-monospace, monospace);
    font-size: 13px; line-height: 1.6;
}
.adm-field.tall textarea { min-height: 120px; }
.adm-field input:focus, .adm-field textarea:focus, .adm-field select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.adm-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.adm-btn {
    font-family: var(--mono, 'IBM Plex Mono', ui-monospace, monospace);
    font-size: 13px; font-weight: 600;
    padding: 9px 16px; border-radius: 6px; border: 1px solid transparent;
    cursor: pointer; text-decoration: none; display: inline-block;
}
.adm-btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.adm-btn.primary:hover { background: var(--accent-hover); color: var(--accent-fg); }
.adm-btn.subtle { background: var(--surface-2); color: var(--fg); border-color: var(--line); }
.adm-btn.subtle:hover { background: var(--content-bg); }
.adm-btn.danger { background: transparent; color: var(--danger); border-color: var(--danger-line); }
.adm-btn.danger:hover { background: var(--danger); color: var(--surface); border-color: var(--danger); }

.adm-rows { display: flex; flex-direction: column; gap: 12px; }
.adm-row {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--fg-muted);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .05);
}
/* the coloured spine says what kind of row this is at a glance */
.adm-row.status-in_progress, .adm-row.kind-feature     { border-left-color: var(--success); }
.adm-row.status-shipped,     .adm-row.kind-improvement { border-left-color: var(--accent); }
.adm-row.kind-fix { border-left-color: var(--warning); }
.adm-row-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-row-title {
    font-family: var(--display, 'Space Grotesk', 'IBM Plex Sans', Arial, sans-serif);
    font-size: 16px; font-weight: 600; color: var(--heading-fg); margin: 0;
    overflow-wrap: anywhere; flex: 1 1 240px;
}
.adm-tag {
    font-family: var(--mono, 'IBM Plex Mono', ui-monospace, monospace);
    font-size: 11px; font-weight: 600; letter-spacing: .05em;
    padding: 3px 9px; border-radius: 9999px; white-space: nowrap;
    background: var(--surface-2); color: var(--fg-muted); border: 1px solid var(--line);
    overflow-wrap: anywhere;
}
.adm-tag.status-planned { background: var(--surface-2); color: var(--fg-muted); }
.adm-tag.status-in_progress, .adm-tag.kind-feature {
    background: var(--success-bg); color: var(--success-fg); border-color: var(--success-line);
}
.adm-tag.status-shipped, .adm-tag.kind-improvement {
    background: var(--success-bg); color: var(--success-fg); border-color: var(--success-line);
}
.adm-tag.kind-fix {
    background: var(--warning-bg); color: var(--warning-fg); border-color: var(--warning-line);
}
.adm-tag.mono-dark { background: var(--ink); color: var(--phosphor); border-color: var(--ink-line); }
.adm-row-sub {
    font-family: var(--mono, 'IBM Plex Mono', ui-monospace, monospace);
    font-size: 11px; color: var(--fg-muted); margin: 8px 0 0;
}
.adm-row-body {
    font-family: var(--mono, 'IBM Plex Mono', ui-monospace, monospace);
    font-size: 12.5px; line-height: 1.6; color: var(--fg-muted);
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
    padding: 10px 12px; margin: 10px 0 0;
    white-space: pre-wrap; overflow-wrap: anywhere;
    max-height: 160px; overflow-y: auto;
}
.adm-row details { margin-top: 12px; }
.adm-row details > summary {
    font-family: var(--mono, 'IBM Plex Mono', ui-monospace, monospace);
    font-size: 12px; font-weight: 600; color: var(--accent);
    cursor: pointer; list-style: none; display: inline-block;
    padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2);
}
.adm-row details > summary::-webkit-details-marker { display: none; }
.adm-row details[open] > summary { background: var(--content-bg); }
.adm-row details > form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.adm-empty {
    font-family: var(--mono, 'IBM Plex Mono', ui-monospace, monospace);
    font-size: 13px; color: var(--fg-muted);
    background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; padding: 18px;
    text-align: center;
}
.adm-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }

/* ---- crawl manager (/dev_crawl) -------------------------------------- */
.cm-box { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 10px 0; background: var(--surface); }
.cm-table { width: 100%; border-collapse: collapse; margin: 8px 0 6px; }
.cm-table th, .cm-table td {
    text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line);
    font-size: 13px; vertical-align: top;
}
.cm-table th { color: var(--fg-muted); }
.cm-muted { color: var(--fg-muted); font-size: 12px; }
.crawl-btn {
    display: inline-block; padding: 5px 10px; margin: 1px; border-radius: 7px;
    border: 1px solid var(--line); font-size: 12.5px;
    background: var(--surface-2); color: var(--fg); cursor: pointer; text-decoration: none;
}
.crawl-btn.ok { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.crawl-btn.del { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-line); }
.cm-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 14px; padding: 3px 6px 3px 11px; margin: 3px; font-size: 12.5px;
}
.cm-x { border: none; background: none; color: var(--danger); cursor: pointer; font-size: 14px; padding: 0; }
.page-content input[type="text"], .page-content input[type="url"] {
    padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px;
    font-family: inherit; font-size: 13px;
    background: var(--input-bg); color: var(--fg);
}


/* =====================================================================
   STORAGE MANAGEMENT  (/dev_storage_management)
   Lifted out of the template's inline <style>, which loaded after this
   file and so held the page light in every theme. Scoped to the page
   wrapper because it redefines .stat-card and .stats-grid, which the
   developer dashboard also uses and must keep its own version of.
   ===================================================================== */
.storage-management {
    margin-top: 20px;
}

.storage-management .storage-stats-summary {
    margin-bottom: 30px;
}

.storage-management .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.storage-management .stat-card {
    background: var(--content-bg);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid var(--accent);
}

.storage-management .stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: var(--accent-text);
    font-weight: bold;
}

.storage-management .stat-card p {
    margin: 0;
    color: var(--fg-muted);
    font-weight: bold;
}

.storage-management .storage-table {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.storage-management .storage-management-card {
    background: var(--content-bg);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--accent);
}

.storage-management .storage-user-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.storage-management .user-avatar .avatar-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.storage-management .user-info h3 {
    margin: 0 0 5px 0;
    color: var(--fg);
}

.storage-management .user-info p {
    margin: 0;
    color: var(--fg-muted);
    font-size: 14px;
}

.storage-management .storage-status {
    margin-left: auto;
}

.storage-management .status-danger {
    background: var(--danger-bg);
    color: var(--danger-fg);
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 12px;
}

.storage-management .status-warning {
    background: var(--warning-bg);
    color: var(--warning-fg);
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 12px;
}

.storage-management .status-ok {
    background: var(--success-bg);
    color: var(--success-fg);
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 12px;
}

.storage-management .storage-bar-container {
    margin-bottom: 15px;
}

.storage-management .storage-bar {
    width: 100%;
    height: 20px;
    background-color: var(--content-bg);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--line);
}

.storage-management .storage-used {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    transition: width 0.3s ease;
}

.storage-management .storage-text {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--fg-muted);
    font-weight: bold;
}

.storage-management .storage-used-text {
    color: var(--accent-text);
}

.storage-management .storage-separator {
    color: var(--fg-muted);
}

.storage-management .storage-total-text {
    color: var(--fg-muted);
}

.storage-management .storage-percentage {
    color: var(--fg);
}

.storage-management .storage-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.storage-management .storage-info-item {
    background: var(--surface);
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    border: 1px solid var(--line);
}

.storage-management .storage-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.storage-management .form-group-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.storage-management .form-group-inline label {
    font-weight: bold;
    color: var(--fg);
}

.storage-management .storage-input {
    width: 80px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.storage-management .grant-btn {
    background-color: var(--accent);
    color: var(--accent-fg);
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.storage-management .grant-btn:hover {
    background-color: var(--accent-hover);
    color: var(--accent-fg);
}


.storage-management .quick-grant-btn {
    background-color: var(--neutral-btn);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.storage-management .quick-grant-btn:hover {
    background-color: var(--neutral-btn-hover);
}

.storage-management .no-storage-data {
    text-align: center;
    padding: 40px;
    color: var(--fg-muted);
}

/* 响应式设计 */@media (max-width: 768px) {
.storage-management .storage-user-header {
        flex-direction: column;
        text-align: center;
    }
    
.storage-management .storage-status {
        margin-left: 0;
    }
    
.storage-management .form-group-inline {
        flex-direction: column;
        align-items: stretch;
    }
}
/* Honor OS "reduce motion": kill decorative spin/animations; keep transitions near-instant. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .page-loader { display: none !important; }
}

/* ------------------------------------------------------------------
   Print-friendly article pages.
   Hide site chrome / interactive UI; keep title, meta, body readable.
   ------------------------------------------------------------------ */
@media print {
  /* Paper defaults: black on white, no decorative chrome. */
  html, body {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  /* Site chrome */
  header,
  header nav,
  footer,
  .skip-link,
  .kbd-help-btn,
  .kbd-help-backdrop,
  .page-loader,
  .theme-selector,
  .theme-toggle-btn,
  .theme-panel,
  .language-selector,
  .alert-message,
  .cookie-consent {
    display: none !important;
  }

  /* Article interactive / navigation chrome */
  .ja-read-progress,
  .ja-back-top,
  .ja-copy-link,
  .ja-copy-link-status,
  .ja-share,
  .ja-print,
  .ja-cite,
  .ja-email,
  .ja-ext-link::after,
  .ja-rss,
  .ja-atom,
  .jr-rss,
  .jr-copy-link,
  .jr-copy-link-status,
  .jr-print,
  .jr-share,
  .jr-email,
  .jp-copy-link,
  .ja-copy-code,
  .ja-code-expand,
  .ja-heading-anchor,
  .ja-band-actions,
  .ja-toc,
  .article-nav,
  .article-like-section,
  .article-detail-actions,
  .article-comments-section,
  .article-add-comment-form,
  .article-delete-comment-form {
    display: none !important;
  }

  /* Keep content readable; drop heavy fills/shadows. */
  .jm-articles,
  .ja-band,
  .ja-body,
  .ja-wrap,
  .ja-post,
  .article-detail,
  .article-detail-content,
  .ja-breadcrumb,
  pre,
  code,
  .ja-code-wrap {
    background: transparent !important;
    box-shadow: none !important;
    color: #000 !important;
  }

  .ja-code-wrap > pre {
    padding-top: 0; /* no room needed once copy button is hidden */
    max-height: none !important;
    overflow: visible !important;
  }
  .ja-code-wrap.is-collapsed::after {
    display: none !important;
  }

  /* Avoid cutting mid-block across pages when possible. */
  h1, h2, h3, h4, .ja-post-title, pre, img, table {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  main#main-content {
    margin: 0;
    padding: 0;
  }
}

/* Show/Hide password toggle (login, register) — static/pw_toggle.js */
.pw-field { position: relative; }
.form-group .pw-field input { padding-right: 76px; }
.pw-toggle {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    padding: 4px 10px; min-height: 30px;
    border: 1px solid var(--line); border-radius: 4px;
    background: var(--surface-2, transparent); color: var(--fg);
    font-size: 13px; line-height: 1; cursor: pointer;
}
.pw-toggle:hover { border-color: var(--accent); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pw-toggle[aria-pressed="true"] { border-color: var(--accent); }

/* "Copy view link" on the Articles list (templates/articles.html), same pill as Updates */
.ja-copy-view {
    margin: 10px 0 0; padding: 4px 12px; border-radius: 9999px; cursor: pointer;
    font-family: var(--mono); font-size: 11.5px; font-weight: 600;
    background: transparent; color: var(--ink-fg-dim); border: 1px solid var(--ink-line);
}
.ja-copy-view:hover { border-color: var(--phosphor); color: var(--phosphor); }
.ja-copy-view:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; }
.ja-copy-view.is-copied { border-color: var(--phosphor); color: var(--phosphor); }

/* Search-word highlight in /updates and /roadmap results (main.highlight_terms) */
mark.jm-hit {
    background: color-mix(in srgb, var(--phosphor, #3ddc84) 28%, transparent);
    color: inherit; border-radius: 3px; padding: 0 1px;
}

/* "Updated" badge on the Articles list for recently edited posts (templates/articles.html) */
.ja-updated-badge {
    display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase; padding: 1px 8px; border-radius: 9999px;
    color: var(--phosphor); border: 1px solid color-mix(in srgb, var(--phosphor) 55%, transparent);
    background: color-mix(in srgb, var(--phosphor) 12%, transparent);
}

/* ---- Upload progress (static/upload_progress.js) ---- */
.up-prog { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line, #8884); border-radius: 10px; background: var(--surface-2, transparent); max-width: 640px; box-sizing: border-box; }
.up-row { margin: 0 0 10px; }
.up-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: .88rem; margin-bottom: 4px; }
.up-name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.up-info { color: var(--fg-muted, #888); font-variant-numeric: tabular-nums; }
.up-prog progress { width: 100%; height: 10px; accent-color: var(--accent, #1f8f4e); }
.up-overall .up-name { font-weight: 700; }
.up-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.up-actions button { padding: 6px 14px; border-radius: 6px; cursor: pointer; }
.up-err { color: #c0392b; font-weight: 600; margin: 8px 0 0; }
.up-failed { border-color: #c0392b; }
.up-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
