/* ===== Pages Admin — Component Styles ===== */

/* Layout */
html,
body {
    height: 100%;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Top Bar ===== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 64px;
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.top-bar-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ===== User Chip ===== */
.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: var(--bg-secondary);
    border-radius: 980px;
    font-size: 13px;
    color: var(--text-secondary);
}

.user-avatar {
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

/* ===== Main Content ===== */
.main {
    flex: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 28px;
    width: 100%;
}

/* ===== Auth Views ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}

.auth-header {
    position: absolute;
    top: 14px;
    right: 28px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 15px;
    font-weight: 400;
}

.auth-toggle {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.auth-toggle a {
    color: var(--accent);
    cursor: pointer;
}

/* ===== SMS Row ===== */
.sms-row {
    display: flex;
    gap: 8px;
}

.sms-row .input {
    flex: 1;
}

.sms-row .btn {
    flex-shrink: 0;
}

/* ===== Step Indicator ===== */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 28px;
}

.step-dot {
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: var(--bg-tertiary);
    transition: all var(--duration) var(--ease);
}

.step-dot.active {
    background: var(--text);
    width: 40px;
}

/* ===== Tab Bar ===== */
.tab-bar {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--divider);
}

.tab-btn {
    flex: 1;
    padding: 10px 0;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    color: var(--text-tertiary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.tab-btn.active {
    color: var(--text);
    border-bottom-color: var(--text);
}

/* ===== Workspace ===== */
.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--divider);
}

.workspace-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.workspace-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.workspace-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.workspace-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg), var(--glow-primary);
}

.workspace-card.active {
    border-color: var(--accent);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--accent-light) 100%);
    box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}

.workspace-card .ws-name {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.workspace-card .ws-meta {
    font-size: 13px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ws-edit-btn {
    padding: 4px 6px !important;
    margin-left: auto;
    opacity: 0;
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    transition: opacity 0.2s var(--ease), background 0.2s var(--ease);
}

.workspace-card:hover .ws-edit-btn {
    opacity: 1;
}

.ws-edit-btn:hover {
    opacity: 1 !important;
    color: var(--accent) !important;
}

.ws-add-card {
    border-style: dashed;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 14px;
    gap: 6px;
    min-height: 80px;
}

.ws-add-card:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}

/* ===== Space Info ===== */
.space-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.space-info code {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ===== Page List ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.page-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius) !important;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.page-item:hover {
    transform: translateY(-2px) scale(1.005);
    box-shadow: var(--shadow);
    border-color: var(--border-focus);
}

.page-item-info {
    flex: 1;
    min-width: 0;
}

.page-item-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.page-item-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.page-item-meta a {
    color: var(--accent);
}

.page-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-tertiary);
}

.empty-state .icon {
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
    color: var(--accent);
}

.empty-state p {
    font-size: 15px;
    margin-bottom: 24px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Editor ===== */
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.editor-header h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.editor-form .form-row {
    display: flex;
    gap: 16px;
}

.editor-form .form-row>.form-group {
    flex: 1;
}

.editor-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    justify-content: flex-end;
}

/* ===== Type Selector ===== */
.type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.type-card {
    padding: 20px 16px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.type-card:hover {
    border-color: var(--accent);
}

.type-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.type-card.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.type-card .type-icon {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.type-card .type-icon svg {
    width: 28px;
    height: 28px;
}

.type-card .type-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.type-card .type-desc {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ===== Style Selector ===== */
.style-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.style-card {
    padding: 12px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-size: 13px;
    font-weight: 500;
}

.style-card:hover {
    border-color: var(--accent);
}

.style-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.style-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.style-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.vip-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #f5a623, #f7c948);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ===== JSON Editor ===== */
.json-editor {
    font-family: var(--font-mono) !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    tab-size: 2;
    white-space: pre;
    resize: vertical;
}

/* ===== Markdown Editor ===== */
.md-toolbar {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.md-toolbar .btn svg {
    display: block;
}

.md-editor {
    display: flex;
    gap: 1px;
    background: var(--divider);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 400px;
    border: 1px solid var(--border);
}

.md-editor-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
}

.md-editor-pane .pane-header {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--divider);
}

.md-editor-pane textarea {
    flex: 1;
    width: 100%;
    border: none;
    resize: none;
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 14px;
    background: transparent;
    color: var(--text);
    line-height: 1.6;
}

.md-editor-pane textarea:focus {
    outline: none;
}

/* ===== Markdown Preview ===== */
.md-preview {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
}

.md-preview h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
}

.md-preview h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 24px 0 8px;
}

.md-preview h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 6px;
}

.md-preview p {
    margin-bottom: 12px;
}

.md-preview blockquote {
    border-left: 3px solid var(--border);
    padding-left: 14px;
    color: var(--text-secondary);
    margin: 12px 0;
}

.md-preview hr {
    border: none;
    border-top: 1px solid var(--divider);
    margin: 20px 0;
}

.md-preview strong {
    font-weight: 700;
}

.md-preview em {
    font-style: italic;
}

.md-preview code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

.md-preview ul,
.md-preview ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

/* ===== Moderation ===== */
.moderation-warn {
    color: var(--danger);
    font-size: 12px;
    margin-top: 6px;
}

/* ===== Tab Header ===== */
.tab-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--divider);
}

.tab-header-text h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}

.tab-header-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Stat Bar ===== */
.stat-bar {
    display: flex;
    gap: 1px;
    background: var(--divider);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--bg-card);
    gap: 4px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===== Inline Form Card ===== */
.inline-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration) var(--ease);
}

.inline-form-card:hover {
    box-shadow: var(--shadow);
}

.inline-form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.inline-form-field {
    flex: 1;
}

.inline-form-field .form-label {
    margin-bottom: 4px;
}

/* ===== Info Banner ===== */
.info-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--accent-light);
    border: 1px solid rgba(0, 113, 227, 0.1);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.info-banner svg {
    flex-shrink: 0;
    color: var(--accent);
    opacity: 0.7;
}

/* ===== Upload Card ===== */
.upload-card {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.upload-area:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.upload-area p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ===== Cert Status Card ===== */
.cert-status-card {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.cert-status-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--divider);
}

.cert-status-text {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.cert-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.cert-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cert-detail-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cert-detail-value {
    font-size: 14px;
    color: var(--text);
}

.cert-detail-item.cert-reject .cert-detail-value {
    color: var(--danger);
}

.cert-license-preview {
    margin-top: 8px;
}

.cert-license-preview img {
    max-width: 320px;
    border-radius: var(--radius);
    border: 1px solid var(--divider);
    transition: transform 0.2s var(--ease);
}

.cert-license-preview img:hover {
    transform: scale(1.02);
}

/* ===== Audit List ===== */
.audit-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.audit-card {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s var(--ease);
    box-shadow: var(--shadow-sm);
}

.audit-card:hover {
    box-shadow: var(--shadow);
}

.audit-card.audit-pending {
    border-left: 3px solid var(--warning);
}

.audit-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.audit-card-user {
    flex: 1;
}

.audit-card-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.audit-card-phone {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.audit-card-body {
    padding-top: 12px;
    border-top: 1px solid var(--divider);
}

.audit-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.audit-license-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    font-weight: 500;
    transition: opacity 0.15s var(--ease);
}

.audit-license-link:hover {
    opacity: 0.7;
}

.audit-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--divider);
}

/* ===== Space Info Right ===== */
.space-info-right {
    margin-left: auto;
    white-space: nowrap;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s var(--ease);
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl), var(--glass-shadow);
    border: 1px solid var(--border);
    animation: modalIn 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal h3 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== Sidebar Layout ===== */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    padding: 0 12px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 12px 6px;
    margin-bottom: 2px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: var(--font);
    position: relative;
}

.sidebar-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text);
    transform: translateX(4px);
}

.sidebar-nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 6px var(--accent);
}

.sidebar-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease);
}

.sidebar-nav-item.active svg {
    opacity: 1;
}

.sidebar-ws-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.sidebar-ws-item:hover {
    background: var(--bg-secondary);
}

.sidebar-ws-item.active {
    color: var(--accent);
    font-weight: 600;
}

.sidebar-ws-item .ws-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
}

.sidebar-ws-item.active .ws-dot {
    background: var(--accent);
}

.sidebar-ws-add {
    font-size: 12px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 12px 4px 28px;
}

.sidebar-ws-add:hover {
    color: var(--accent);
}

.sidebar-spacer {
    flex: 1;
}

.sidebar-user {
    padding: 14px 16px;
    border-top: 1px solid var(--divider);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    margin-top: 8px;
}

.sidebar-user .user-avatar {
    background: linear-gradient(135deg, var(--accent), #6366f1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.content {
    flex: 1;
    padding: 28px 36px;
    min-width: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .main {
        padding: 20px 16px;
    }

    .page-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-item-actions {
        width: 100%;
    }

    .editor-form .form-row {
        flex-direction: column;
        gap: 0;
    }

    .workspace-cards {
        grid-template-columns: 1fr;
    }

    .md-editor {
        flex-direction: column;
        min-height: 300px;
    }

    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--divider);
        padding: 8px 0;
        flex-direction: row;
        overflow-x: auto;
    }

    .sidebar-section {
        margin-bottom: 0;
        display: flex;
        flex-direction: row;
        gap: 4px;
        align-items: center;
    }

    .sidebar-section-title {
        display: none;
    }

    .sidebar-nav-item.active::before {
        display: none;
    }

    .sidebar-spacer {
        display: none;
    }

    .sidebar-user {
        display: none;
    }

    .content {
        padding: 20px 16px;
    }

    .stat-bar {
        flex-wrap: wrap;
    }

    .stat-item {
        min-width: 70px;
    }

    .inline-form-row {
        flex-direction: column;
    }

    .inline-form-row .btn {
        margin-top: 8px !important;
        width: 100%;
    }

    .audit-card-actions {
        flex-wrap: wrap;
    }

    .cert-detail-grid {
        grid-template-columns: 1fr;
    }

    .member-quota-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pay-plan-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 会员状态 ===== */
.member-status-card {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.member-plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.member-plan-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.member-plan-badge.paid {
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: #fff;
}

.member-expire {
    font-size: 13px;
    color: var(--text-tertiary);
}

.member-storage {
    margin-bottom: 20px;
}

.member-storage-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.member-progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.member-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #6366f1);
    border-radius: 3px;
    transition: width 0.5s var(--ease);
    min-width: 2px;
}

.member-quota-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: var(--divider);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.member-quota-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px;
    background: var(--bg-secondary);
    gap: 4px;
}

.member-quota-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.member-quota-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ===== 支付弹窗 ===== */
.pay-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.pay-plan-card {
    position: relative;
    padding: 20px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--divider);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    text-align: center;
}

.pay-plan-card:hover {
    border-color: var(--accent);
}

.pay-plan-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
    background: var(--accent-light);
}

.pay-plan-card.recommended {
    border-color: var(--accent);
}

.pay-plan-badge {
    position: absolute;
    top: -8px;
    right: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
}

.pay-plan-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.pay-plan-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
}

.pay-plan-price span {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
}

.pay-plan-features {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===== 图片空间 ===== */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.image-card {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s var(--ease);
}

.image-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.08);
    transform: translateY(-2px);
}

.image-thumb {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-tertiary);
    cursor: pointer;
    transition: opacity 0.2s;
}

.image-thumb:hover {
    opacity: 0.85;
}

.image-card-info {
    padding: 10px 12px 4px;
}

.image-card-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.image-card-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.image-card-actions {
    display: flex;
    justify-content: flex-end;
    padding: 4px 8px 8px;
    gap: 4px;
}