        :root {
            --bg: #f3f8f4;
            --surface: rgba(255, 255, 255, 0.88);
            --surface-solid: #ffffff;
            --text: #111827;
            --muted: #6b7280;
            --border: #e5e7eb;
            --primary: #60b273;
            --primary-dark: #306640;
            --primary-soft: #e3f5e7;
            --success: #16a34a;
            --danger: #dc2626;
            --danger-soft: #fee2e2;
            --shadow: 0 18px 48px rgba(15, 23, 42, 0.10);
            --radius-xl: 26px;
            --radius-lg: 18px;
            --radius-md: 12px;
        }

        * { box-sizing: border-box; }

        body {
            margin: 0;
            min-height: 100vh;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
            color: var(--text);
            background:
                radial-gradient(circle at 12% 10%, rgba(96, 178, 115, 0.16), transparent 28%),
                radial-gradient(circle at 88% 12%, rgba(64, 128, 80, 0.14), transparent 30%),
                linear-gradient(135deg, #f8fbf8 0%, #edf6ee 48%, #f8fcf9 100%);
        }

        a { color: var(--primary-dark); text-decoration: none; }
        a:hover { text-decoration: underline; }

        .app-shell {
            width: min(1600px, calc(100% - 36px));
            margin: 0 auto;
            padding: 34px 0 60px;
        }

        .hero {
            position: relative;
            overflow: hidden;
            padding: 34px;
            border: 1px solid rgba(255, 255, 255, 0.72);
            border-radius: var(--radius-xl);
            background: linear-gradient(135deg, rgba(43, 94, 57, 0.95), rgba(63, 124, 78, 0.95) 48%, rgba(64, 128, 80, 0.84));
            color: #fff;
            box-shadow: var(--shadow);
        }

        .hero::after {
            content: "";
            position: absolute;
            right: -80px;
            top: -80px;
            width: 260px;
            height: 260px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.16);
        }

        .hero-top {
            position: relative;
            z-index: 1;
            display: flex;
            justify-content: space-between;
            gap: 20px;
            align-items: flex-start;
        }

        .brand-title {
            margin: 0 0 10px;
            font-size: clamp(32px, 5vw, 52px);
            line-height: 1.05;
            letter-spacing: -1.6px;
        }

        .brand-desc {
            margin: 0;
            max-width: 660px;
            color: rgba(255, 255, 255, 0.86);
            font-size: 16px;
            line-height: 1.8;
        }

        .hero-badges {
            position: relative;
            z-index: 1;
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            margin-top: 24px;
        }

        .badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 9px 13px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.16);
            border: 1px solid rgba(255, 255, 255, 0.18);
            backdrop-filter: blur(10px);
            font-size: 13px;
            color: rgba(255, 255, 255, 0.92);
            white-space: nowrap;
        }

        .logout-form { margin: 0; }

        .grid {
            display: grid;
            grid-template-columns: minmax(260px, 310px) minmax(0, 1fr);
            gap: 22px;
            margin-top: 22px;
            align-items: start;
        }

        .panel {
            border: 1px solid rgba(255, 255, 255, 0.82);
            border-radius: var(--radius-xl);
            background: var(--surface);
            box-shadow: var(--shadow);
            backdrop-filter: blur(18px);
        }

        .panel-header {
            padding: 22px 24px 0;
        }

        .panel-title {
            margin: 0;
            font-size: 20px;
            letter-spacing: -0.3px;
        }

        .panel-subtitle {
            margin: 8px 0 0;
            color: var(--muted);
            line-height: 1.7;
            font-size: 14px;
        }

        .panel-body { padding: 22px 24px 24px; }

        .field {
            width: 100%;
            border: 1px solid var(--border);
            background: #fff;
            border-radius: 14px;
            padding: 12px 14px;
            font-size: 15px;
            outline: none;
            transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
        }

        .field:focus {
            border-color: rgba(96, 178, 115, .58);
            box-shadow: 0 0 0 4px rgba(96, 178, 115, .12);
        }

        textarea.field {
            min-height: 230px;
            resize: vertical;
            line-height: 1.75;
        }

        .form-stack { display: grid; gap: 14px; }
        .form-stack[hidden] { display: none; }
        .registration-hint { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            border: none;
            border-radius: 14px;
            padding: 11px 15px;
            cursor: pointer;
            font-weight: 700;
            line-height: 1;
            transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
            text-decoration: none;
            white-space: nowrap;
        }

        .btn:hover { transform: translateY(-1px); text-decoration: none; }
        .btn:active { transform: translateY(0); }

        .btn-primary {
            color: #fff;
            background: linear-gradient(135deg, #38774a, #326c43);
            box-shadow: 0 12px 22px rgba(96, 178, 115, 0.25);
        }

        .btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), #2a5b38); }

        .btn-secondary {
            color: #1f2937;
            background: #fff;
            border: 1px solid var(--border);
        }

        .btn-soft {
            color: var(--primary-dark);
            background: var(--primary-soft);
        }

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

        .btn-ghost {
            color: rgba(255, 255, 255, 0.92);
            background: rgba(255, 255, 255, 0.14);
            border: 1px solid rgba(255, 255, 255, 0.18);
        }

        .btn-sm {
            padding: 8px 11px;
            border-radius: 11px;
            font-size: 13px;
        }

        .auth-card {
            width: min(430px, 100%);
            margin: 26px auto 0;
        }

        .auth-card-header {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: center;
            gap: 8px 12px;
        }

        .auth-card-header .panel-subtitle {
            grid-column: 1 / -1;
            margin-top: 0;
        }

        .auth-card-header .auth-features-link {
            grid-column: 2;
            white-space: nowrap;
        }

        .account-actions,
        .auth-actions {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }

        .account-actions { flex: 0 0 auto; }

        .account-actions .btn,
        .auth-actions .btn {
            width: 100%;
            min-height: 42px;
            font-family: inherit;
            font-size: 14px;
        }

        .registration { margin-top: 14px; }

        .admin-panel { margin-top: 22px; }
        .admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin: 0 0 24px; }
        .admin-stats > div { padding: 14px; background: var(--primary-soft); border-radius: var(--radius-md); }
        .admin-stats dd { margin: 5px 0 0; font-weight: 700; }
        .admin-table-wrap { overflow-x: auto; margin-bottom: 24px; }
        .admin-table { width: 100%; border-collapse: collapse; text-align: left; }
        .admin-table th, .admin-table td { padding: 12px; border-bottom: 1px solid var(--border); }
        .admin-table td:last-child { min-width: 12rem; }
        .admin-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
        .admin-row-actions .btn { width: auto; }
        .admin-edit-icon { min-width: 30px; padding: 5px 8px; margin-left: 4px; font-size: 13px; }
        .admin-identity { overflow-wrap: anywhere; }
        .admin-table time { white-space: nowrap; }
        .admin-table small { display: block; color: var(--muted); }
        .account-dialog { width: min(420px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 24px; border: 1px solid var(--border); border-radius: 20px; }
        .account-dialog::backdrop { background: rgba(20, 40, 28, .55); }
        .account-dialog h3 { margin: 0; }
        .account-dialog .field { display: block; width: 100%; margin-top: 6px; }
        .account-dialog label[hidden] { display: none; }
        .auth-secondary-actions { margin-top: 14px; }
        .registration-status { color: var(--muted); font-size: 13px; margin: -6px 0 0; }
        [data-registration-send]:disabled { opacity: .68; cursor: wait; transform: none; }

        .alert {
            margin: 18px 0 0;
            padding: 13px 15px;
            border-radius: 16px;
            border: 1px solid transparent;
            font-size: 14px;
            line-height: 1.6;
        }

        .alert-success {
            background: #ecfdf5;
            border-color: #bbf7d0;
            color: #166534;
        }

        .alert-error {
            background: #fef2f2;
            border-color: #fecaca;
            color: #991b1b;
        }

        .toolbar {
            display: grid;
            gap: 14px;
            margin-bottom: 18px;
        }

        .filter-bar, .bulk-bar {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            align-items: center;
            padding: 14px;
            background: rgba(255, 255, 255, 0.74);
            border: 1px solid rgba(229, 231, 235, 0.9);
            border-radius: 18px;
        }

        .filter-bar .search-input { flex: 1 1 260px; }
        .bulk-bar select, .filter-bar select { width: auto; min-width: 130px; }

        .summary-line {
            color: var(--muted);
            font-size: 13px;
            line-height: 1.6;
        }

        .notes-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
            gap: 16px;
        }

        .note {
            position: relative;
            padding: 18px;
            border: 1px solid rgba(229, 231, 235, 0.92);
            border-radius: 22px;
            background: var(--surface-solid);
            box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
            transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
        }

        .note:hover {
            transform: translateY(-2px);
            box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
            border-color: rgba(96, 178, 115, 0.25);
        }

        .note-top {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr);
            gap: 12px;
            align-items: start;
        }

        .note-check {
            width: 18px;
            height: 18px;
            margin-top: 6px;
            accent-color: var(--primary);
        }

        .note { min-width: 0; }
        .note-top .note-actions { grid-column: 2; justify-content: flex-start; }

        .note-title {
            margin: 0;
            font-size: 19px;
            line-height: 1.35;
            word-break: break-word;
        }

        .note-meta {
            margin-top: 6px;
            color: var(--muted);
            font-size: 12px;
        }

        .note-content {
            margin: 14px 0 0;
            max-height: 270px;
            overflow: auto;
            color: #374151;
            line-height: 1.85;
            white-space: pre-wrap;
            word-break: break-word;
            padding-right: 4px;
        }

        .note-code {
            margin: 0;
            padding: 14px 16px;
            background: #192421;
            color: #def1e8;
            border-radius: 12px;
            overflow-x: auto;
            font: 13px/1.65 ui-monospace, Consolas, monospace;
            white-space: pre;
            word-break: normal;
            tab-size: 4;
        }

        .note-actions {
            display: flex;
            gap: 8px;
            align-items: center;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .delete-form { margin: 0; }

        .empty-state {
            padding: 46px 22px;
            text-align: center;
            color: var(--muted);
            border: 1px dashed #cbd5e1;
            border-radius: 22px;
            background: rgba(255,255,255,.72);
        }

        .pagination {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            flex-wrap: wrap;
            margin-top: 18px;
            padding-top: 18px;
            border-top: 1px solid rgba(229, 231, 235, 0.9);
        }

        .page-list {
            display: flex;
            gap: 6px;
            align-items: center;
            flex-wrap: wrap;
        }

        .page-link, .page-ellipsis {
            min-width: 38px;
            height: 38px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0 10px;
            border-radius: 12px;
            border: 1px solid var(--border);
            background: #fff;
            color: #374151;
            font-weight: 700;
            font-size: 13px;
        }

        .page-link:hover { text-decoration: none; border-color: rgba(96, 178, 115, .38); color: var(--primary-dark); }
        .page-link.active { background: var(--primary-dark); color: #fff; border-color: var(--primary); }
        .page-link.disabled { opacity: .45; pointer-events: none; }
        .page-ellipsis { border-color: transparent; background: transparent; min-width: 24px; }

        .floating-actions {
            position: fixed;
            right: 22px;
            bottom: 22px;
            display: grid;
            gap: 10px;
            z-index: 50;
        }

        .float-btn {
            width: 44px;
            height: 44px;
            border-radius: 999px;
            border: none;
            color: #fff;
            background: rgba(17, 24, 39, .86);
            box-shadow: 0 12px 26px rgba(15, 23, 42, .22);
            cursor: pointer;
            opacity: 0;
            pointer-events: none;
            transition: opacity .2s ease, transform .2s ease;
        }

        .float-btn.show { opacity: 1; pointer-events: auto; }
        .float-btn:hover { transform: translateY(-2px); }

        .modal-mask {
            position: fixed;
            inset: 0;
            display: none;
            place-items: center;
            padding: 18px;
            background: rgba(15, 23, 42, .46);
            backdrop-filter: blur(8px);
            z-index: 80;
        }

        .modal-mask.show { display: grid; }

        .modal-card {
            width: min(720px, 100%);
            max-height: 92vh;
            overflow: auto;
            background: #fff;
            border-radius: 26px;
            box-shadow: 0 28px 80px rgba(0,0,0,.26);
            padding: 24px;
        }

        .modal-head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
        }

        .modal-head h3 { margin: 0; font-size: 22px; }
        .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

        #editModal .modal-card {
            width: min(1200px, 100%);
            height: min(1000px, calc(100dvh - 36px));
            max-height: calc(100dvh - 36px);
            display: flex;
            flex-direction: column;
            overflow: auto;
        }

        #editModal .modal-head { flex-shrink: 0; }
        #editNoteForm { flex: 1; min-height: 0; grid-template-rows: auto minmax(100px, 1fr) auto; }
        #editContent { height: 100%; min-height: 100px; resize: none; }

        @media (max-width: 680px) {
            #editModal .modal-card {
                height: calc(100dvh - 20px);
                max-height: calc(100dvh - 20px);
            }
        }

        .toast {
            position: fixed;
            left: 50%;
            bottom: 26px;
            transform: translateX(-50%) translateY(20px);
            background: #111827;
            color: #fff;
            padding: 10px 14px;
            border-radius: 999px;
            opacity: 0;
            pointer-events: none;
            transition: opacity .2s ease, transform .2s ease;
            z-index: 100;
            font-size: 13px;
        }

        .toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        @media (max-width: 767px) {
            .notes-grid { grid-template-columns: minmax(0, 1fr); }
        }

        @media (max-width: 940px) {
            .grid { grid-template-columns: 1fr; }
            .hero-top { flex-direction: column; }
        }

        @media (max-width: 640px) {
            .app-shell { width: calc(100% - 24px); padding-top: 12px; }
            .hero { padding: 18px; border-radius: 20px; }
            .hero-top { gap: 14px; }
            .brand-title { font-size: 30px; }
            .brand-desc { font-size: 14px; line-height: 1.55; }
            .hero-badges { margin-top: 14px; gap: 6px; }
            .badge { max-width: 100%; overflow-wrap: anywhere; white-space: normal; padding: 6px 9px; }
            .panel { min-width: 0; border-radius: 20px; }
            .panel-header { padding: 16px 14px 0; }
            .panel-body { padding: 16px 14px; }
            .auth-card { margin-top: 18px; }
            .field { min-width: 0; font-size: 16px; }
            textarea.field { min-height: 168px; }
            .btn { min-height: 44px; }
            .account-actions { width: 100%; }
            .auth-actions, .account-actions { gap: 8px; }
            .note { padding: 13px; }
            .note-top { grid-template-columns: auto minmax(0, 1fr); }
            .note-top .note-actions { grid-column: 1 / -1; }
            .note-actions .btn { min-height: 40px; }
            .note-content { max-height: 44vh; }
            .filter-bar .search-input { flex: 1 1 100%; }
            .filter-bar select, .bulk-bar select { flex: 1 1 100%; width: 100%; }
            .page-list { width: 100%; justify-content: center; }
            .pagination { justify-content: center; }
            .modal-mask { padding: 10px; }
            .modal-card { max-height: 90dvh; padding: 16px; }
            .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
            .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
            .admin-stats > div { padding: 10px; font-size: 13px; }
            .admin-row-actions { margin-top: 6px; }
            .admin-row-actions .btn { padding-inline: 7px; min-height: 40px; }
            .admin-edit-icon { min-height: 36px; }
        }
        #importForm p { margin: 0; }
        #importPreview[hidden] { display: none; }
        #noteEncryption [hidden], #registrationSecretFields[hidden], dialog.account-dialog [hidden] { display: none !important; }
        .hero-overview {
            position: relative;
            z-index: 1;
            display: flex;
            flex-wrap: wrap;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px 16px;
            margin-top: 24px;
        }
        .hero-overview .hero-badges { min-width: 0; margin-top: 0; gap: 8px; }
        .hero-overview .badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
        .hero-overview .badge, .hero-note-actions .btn {
            min-height: 38px;
            padding: 8px 13px;
            border: 1px solid rgba(255, 255, 255, .24);
            border-radius: 999px;
            background: rgba(255, 255, 255, .16);
            color: #fff;
            font-size: 13px;
            line-height: 1.3;
        }
        .hero-note-actions {
            display: flex;
            justify-content: flex-end;
            align-items: flex-start;
            gap: 8px;
            margin-inline-start: auto;
        }
        .hero-note-actions .btn:hover, .hero-note-actions .btn:focus-visible {
            background: rgba(255, 255, 255, .26);
            border-color: rgba(255, 255, 255, .6);
        }
        .hero-note-actions .btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
        #noteEncryption { display: flex; align-items: flex-start; gap: 8px; }
        #noteEncryption .summary-line { max-width: min(30ch, 42vw); color: #fff; text-align: right; }
        #noteEncryption .summary-line:empty { display: none; }
        .note-operation-status { margin-top: 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--text); overflow-wrap: anywhere; }
        .note-operation-status:empty { display: none; }
        @media (max-width: 640px) {
            .hero-overview { margin-top: 14px; }
            .hero-overview .badge { padding-inline: 9px; }
            .hero-note-actions, #noteEncryption { gap: 6px; }
            .hero-note-actions .btn { min-height: 44px; padding-inline: 9px; }
        }
        #registrationSecretFields { padding: 12px; border: 1px solid #d8e2eb; border-radius: 12px; }
        #registrationSecretFields .field { margin: 6px 0; }
        .registration-secret-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
