*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", sans-serif;
}
body{
    background-color: #f5f7fa;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding:20px;
}
body.page-top{
    align-items:flex-start;
}
.box{
    background:#fff;
    width: 480px;
    padding:35px;
    border-radius:16px;
    box-shadow:0 4px 24px rgba(0,0,0,0.07);
    position:relative;
}
.logo-top{
    text-align:center;
    margin-bottom:24px;
}
.logo-top img{
    max-width:120px;
    height:auto;
}
.title{
    font-size:24px;
    color:#1f2937;
    text-align:center;
    margin-bottom:28px;
    font-weight:500;
}
.sub-nav{
    text-align:center;
    margin:-14px 0 22px;
}
.sub-nav a{
    color:#2563eb;
    text-decoration:none;
    font-size:14px;
}
.sub-nav a:hover{
    text-decoration:underline;
}
.sub-nav-corner{
    text-align:right;
    margin:18px 0 0;
}
.sub-nav-corner a{
    font-size:13px;
}
.form-item{
    margin-bottom:20px;
}
.form-item label{
    display:block;
    font-size:14px;
    color:#4b5563;
    margin-bottom:8px;
}
.form-item input{
    width:100%;
    height:48px;
    padding:0 16px;
    border:1px solid #d1d5db;
    border-radius:10px;
    font-size:15px;
    transition:0.2s;
}
.form-item input:focus{
    outline:none;
    border-color:#2563eb;
    box-shadow:0 0 0 3px rgba(37,99,235,0.12);
}
.form-item input:disabled{
    background-color: #eee;
    cursor: not-allowed;
}
.btn-row{
    display:flex;
    gap:14px;
    margin-top:10px;
}
.btn-row.two{
    margin-top:4px;
    margin-bottom:24px;
    align-items:center;
}
.check-btn{
    width:140px;
    height:48px;
    background:#10b981;
    color:#fff;
    border:none;
    border-radius:10px;
    font-size:15px;
    cursor:pointer;
}
.check-btn:disabled,
.submit-btn:disabled,
.reset-btn:disabled{
    opacity:0.65;
    cursor:not-allowed;
}
.submit-btn{
    flex:1;
    height:48px;
    background:#2563eb;
    color:#fff;
    border:none;
    border-radius:10px;
    font-size:16px;
    cursor:pointer;
}
.reset-btn{
    flex:1;
    height:48px;
    background:#e5e7eb;
    color:#1f2937;
    border:none;
    border-radius:10px;
    font-size:16px;
    cursor:pointer;
}
.alert{
    padding:14px 16px;
    border-radius:10px;
    margin-bottom:20px;
    font-size:14px;
}
.alert-success{
    background:#dcfce7;
    color:#166534;
}
.alert-error{
    background:#fee2e2;
    color:#b91c1c;
}
pre{
    margin-top:8px;
    white-space:pre-wrap;
    word-break:break-all;
    max-height:200px;
    overflow:auto;
    padding:8px;
    background:#f9fafb;
    border-radius:6px;
}
#checkTip{
    font-size:14px;
    padding-left:10px;
    line-height:1.5;
    min-height:24px;
}
.trace-id{
    margin-top:2px;
    font-size:12px;
    color:#6b7280;
    word-break:break-all;
}

.box-wide{
    width:min(1200px, 96vw);
}

.box-matrix{
    width:min(1200px, 96vw);
    max-width:96vw;
}

.table-wrap{
    width:100%;
    max-width:100%;
    overflow-x:auto;
}

.share-table{
    width:100%;
    border-collapse:collapse;
    font-size:14px;
}

.share-table th,
.share-table td{
    border:1px solid #e5e7eb;
    padding:10px 12px;
    vertical-align:top;
    text-align:left;
}

.share-table th{
    background:#f3f4f6;
    color:#111827;
    font-weight:600;
}

.share-table:not(.matrix-table) tr:nth-child(even) td{
    background:#fafafa;
}

.users-count{
    display:inline-block;
    color:#374151;
    font-size:12px;
    margin-bottom:4px;
}

.users-list{
    color:#111827;
    line-height:1.5;
    word-break:break-word;
}

.empty-cell{
    text-align:center;
    color:#6b7280;
}

.error-list{
    margin:8px 0 0 18px;
}

.matrix-legend{
    display:flex;
    flex-wrap:wrap;
    gap:16px;
    margin-bottom:16px;
    color:#374151;
    font-size:13px;
}

.legend-item{
    display:inline-flex;
    align-items:center;
    gap:6px;
}

.legend-swatch{
    width:18px;
    height:18px;
    border:1px solid #d1d5db;
    border-radius:4px;
    display:inline-block;
}

.legend-write{
    background:#86efac;
}

.legend-read{
    background:#fde68a;
}

.legend-none{
    background:#ffffff;
}

.matrix-filters{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:12px;
    margin-bottom:16px;
}

.matrix-filter-item{
    display:inline-flex;
    align-items:center;
    gap:8px;
    color:#374151;
    font-size:14px;
}

.matrix-filter-item select{
    height:38px;
    padding:0 12px;
    border:1px solid #d1d5db;
    border-radius:8px;
    font-size:14px;
    background:#fff;
}

.filter-btn{
    height:38px;
    padding:0 18px;
    background:#2563eb;
    color:#fff;
    border:none;
    border-radius:8px;
    font-size:14px;
    cursor:pointer;
}

.matrix-table{
    width:max-content;
    min-width:100%;
    table-layout:auto;
}

.matrix-user-header,
.matrix-user-name{
    position:sticky;
    left:0;
    z-index:2;
    background:#f3f4f6;
    white-space:nowrap;
}

.matrix-user-name{
    font-weight:600;
    color:#111827;
}

.matrix-share-header{
    text-align:center;
    white-space:nowrap;
}

.matrix-cell{
    height:48px;
}

.perm-write{
    background:#86efac;
}

.perm-read{
    background:#fde68a;
}

.perm-none{
    background:#ffffff;
}

.box-browser{
    width:min(1200px, 96vw);
}

.browser-auth-form,
.browser-path-form{
    margin-bottom:16px;
}

.browser-auth-grid,
.browser-path-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(260px, 1fr));
    gap:14px;
}

.browser-select{
    width:100%;
    height:48px;
    padding:0 12px;
    border:1px solid #d1d5db;
    border-radius:10px;
    font-size:14px;
    background:#fff;
}

.browser-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:12px;
}

.browser-user{
    color:#1f2937;
    font-size:14px;
}

.browser-breadcrumb{
    margin-bottom:12px;
    color:#374151;
    font-size:13px;
    word-break:break-all;
}

.browser-actions{
    display:flex;
    gap:10px;
    justify-content:flex-end;
    margin-bottom:14px;
}

.browser-actions .filter-btn{
    text-decoration:none;
    line-height:38px;
}

.browser-actions-bottom{
    margin-top:10px;
    justify-content:flex-end;
}

.browser-actions-mobile{
    display:none;
    margin-bottom:12px;
}

.browser-mobile-select{
    width:100%;
    height:36px;
    padding:0 10px;
    border:1px solid #d1d5db;
    border-radius:8px;
    font-size:13px;
    color:#1f2937;
    background:#fff;
}

.sr-only{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0, 0, 0, 0);
    border:0;
}

.selected-count-tip{
    display:inline-flex;
    align-items:center;
    padding:0 10px;
    height:38px;
    border-radius:8px;
    background:#f3f4f6;
    color:#4b5563;
    font-size:13px;
}

.browser-check-col{
    width:24px;
    min-width:24px;
    text-align:center;
}

.browser-check-col input[type="checkbox"]{
    width:14px;
    height:14px;
    vertical-align:middle;
}

.browser-name-col{
    width:62%;
    min-width:340px;
}

.browser-entry-link{
    display:inline-block;
    max-width:100%;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    text-decoration:none;
    cursor:pointer;
    border-radius:6px;
    padding:2px 6px;
    background:transparent;
    transition:background-color 0.18s ease, color 0.18s ease, font-weight 0.18s ease;
}

.browser-entry-link:hover{
    background:#e8f2ff;
    font-weight:600;
    text-decoration:none;
}

.browser-entry-link-dir{
    color:#1d4ed8;
}

.browser-entry-link-dir:hover{
    color:#1e3a8a;
}

.browser-entry-link-file{
    color:#166534;
}

.browser-entry-link-file:hover{
    color:#14532d;
}

.entry-type{
    display:inline-block;
    padding:2px 8px;
    border-radius:999px;
    font-size:12px;
    font-weight:600;
}

.entry-type-dir{
    color:#1d4ed8;
    background:#dbeafe;
}

.entry-type-file{
    color:#166534;
    background:#dcfce7;
}

.browser-table th:nth-child(1){
    min-width:24px;
}

.browser-table th:nth-child(2){
    min-width:340px;
}

.browser-table th:nth-child(5){
    min-width:90px;
}

@media (max-width: 860px){
    .browser-auth-grid,
    .browser-path-grid{
        grid-template-columns:1fr;
    }

    .browser-toolbar{
        flex-direction:column;
        align-items:flex-start;
    }

    .browser-actions{
        gap:8px;
        margin-bottom:10px;
    }

    .browser-actions .filter-btn{
        height:34px;
        line-height:34px;
        padding:0 12px;
        font-size:13px;
    }

    .selected-count-tip{
        height:34px;
        font-size:12px;
    }
}

@media (max-width: 760px){
    .browser-table th:nth-child(5),
    .browser-table td:nth-child(5){
        display:none;
    }

    .browser-name-col,
    .browser-table th:nth-child(2){
        min-width:280px;
        width:68%;
    }

    .browser-actions,
    .browser-actions-bottom{
        flex-wrap:wrap;
    }
}

@media (max-width: 620px){
    .browser-table th:nth-child(4),
    .browser-table td:nth-child(4){
        display:none;
    }

    .browser-name-col,
    .browser-table th:nth-child(2){
        min-width:220px;
        width:74%;
    }

    .entry-type{
        font-size:11px;
        padding:2px 6px;
    }
}

@media (max-width: 480px){
    .browser-actions-desktop{
        display:none;
    }

    .browser-actions-mobile{
        display:block;
    }

    .browser-table th:nth-child(3){
        width:30px;
        min-width:30px;
        text-align:center;
    }

    .browser-table td:nth-child(3){
        text-align:center;
    }

    .entry-type{
        width:10px;
        height:10px;
        padding:0;
        border-radius:999px;
        font-size:0;
        color:transparent;
        overflow:hidden;
        vertical-align:middle;
    }

    .entry-type-dir{
        background:#3b82f6;
        box-shadow:0 0 0 1px #bfdbfe;
    }

    .entry-type-file{
        background:#22c55e;
        box-shadow:0 0 0 1px #bbf7d0;
    }

    .browser-entry-link{
        padding:2px 4px;
    }

    .browser-name-col,
    .browser-table th:nth-child(2){
        min-width:180px;
        width:78%;
    }
}

.portal-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
}

.portal-user{
    font-size:14px;
    color:#1f2937;
}

.portal-menu-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:10px;
    margin-bottom:20px;
}

.portal-menu-item{
    display:block;
    border:1px solid #dbe3f0;
    border-radius:10px;
    padding:12px 14px;
    text-decoration:none;
    color:#1f2937;
    background:#f8fafc;
    text-align:center;
    font-size:14px;
}

.portal-menu-item:hover{
    background:#eff6ff;
    border-color:#2563eb;
    color:#1d4ed8;
}

.logout-btn{
    height:40px;
    min-width:96px;
    padding:0 14px;
    border:1px solid #d1d5db;
    border-radius:10px;
    background:#f8fafc;
    color:#374151;
    font-size:14px;
    line-height:1;
    transition:background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.logout-btn:hover{
    background:#f3f4f6;
    border-color:#cbd5e1;
    color:#1f2937;
    box-shadow:0 1px 2px rgba(15,23,42,0.06);
}

.logout-btn:active{
    background:#e5e7eb;
}

@media (max-width: 560px){
    .portal-toolbar{
        flex-direction:column;
        align-items:flex-start;
    }

    .portal-menu-grid{
        grid-template-columns:1fr;
    }
}