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

body {
    font-family: "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 50%, #2c5f8d 100%);
    min-height: 100vh;
    color: #1f1f1f;
}

.app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 28px 48px;
}

/* 顶栏 */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    color: #fff;
}

.topbar .left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar .center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 16px;
}

.search-box {
    width: 100%;
    max-width: 360px;
    padding: 9px 14px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: rgba(255, 255, 255, 0.92);
    color: #2c5f8d;
}

.search-box::placeholder {
    color: #8aa;
}

.search-box:focus {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.topbar h1 {
    font-size: 26px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.topbar .right {
    display: flex;
    gap: 12px;
}

.btn {
    background: rgba(255, 255, 255, 0.9);
    color: #2c5f8d;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn:hover {
    background: #fff;
    transform: translateY(-1px);
}

.btn.primary {
    background: #ffb733;
    color: #5c3d00;
}

.btn.primary:hover {
    background: #ffc04d;
}

.hidden {
    display: none !important;
}

/* 文件夹网格 */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.folder-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    padding: 22px 16px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    position: relative;
}

.folder-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.folder-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 12px;
}

.folder-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c5f8d;
    margin-bottom: 4px;
}

.folder-count {
    font-size: 13px;
    color: #888;
}

.folder-del {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: #c0392b;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: none;
    align-items: center;
    justify-content: center;
}

.folder-card:hover .folder-del {
    display: flex;
}

.folder-del:hover {
    background: #c0392b;
    color: #fff;
}

/* 文件列表 */
.file-view {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.drop-zone {
    background: rgba(255, 255, 255, 0.15);
    border: 2px dashed rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    padding: 28px;
    text-align: center;
    color: #fff;
    transition: all 0.2s;
}

.drop-zone.over {
    background: rgba(255, 255, 255, 0.3);
    border-color: #fff;
}

.drop-zone p {
    margin-top: 8px;
    font-size: 14px;
    opacity: 0.9;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s;
}

.file-row:hover {
    transform: translateX(3px);
}

.file-thumb {
    font-size: 30px;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

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

.file-name {
    font-size: 15px;
    font-weight: 600;
    color: #2c5f8d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.file-actions button {
    background: #f0f0f0;
    border: none;
    border-radius: 7px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #555;
    transition: all 0.15s;
}

.file-actions .dl:hover {
    background: #4a90d9;
    color: #fff;
}

.file-actions .del:hover {
    background: #c0392b;
    color: #fff;
}

.empty-hint {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 40px;
    font-size: 15px;
}

.search-hint {
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    padding: 24px;
    font-size: 14px;
}

.cat-tag {
    display: inline-block;
    background: #e3eefb;
    color: #2c5f8d;
    border-radius: 10px;
    padding: 2px 10px;
    font-size: 12px;
    margin-right: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.cat-tag:hover {
    background: #4a90d9;
    color: #fff;
}

/* 登录/注册 */
.auth-view {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #4a90d9 0%, #2c5f8d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.auth-box {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    width: 320px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.auth-box h2 {
    color: #2c5f8d;
    margin-bottom: 22px;
    font-size: 22px;
}

.auth-box input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #ddd;
    border-radius: 9px;
    font-size: 15px;
    margin-bottom: 14px;
    outline: none;
    transition: border 0.15s;
    box-sizing: border-box;
}

.auth-box input:focus {
    border-color: #4a90d9;
}

.btn-block {
    width: 100%;
    padding: 11px;
    font-size: 16px;
}

.auth-error {
    color: #c0392b;
    font-size: 13px;
    margin: -4px 0 14px;
    min-height: 18px;
}

.auth-toggle {
    margin-top: 18px;
    font-size: 14px;
    color: #888;
}

.auth-toggle a {
    color: #4a90d9;
    cursor: pointer;
    text-decoration: underline;
}

/* 用户信息 */
.user-info {
    color: #fff;
    font-size: 14px;
    margin-right: 4px;
    opacity: 0.9;
}

/* 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    width: 340px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal-box h3 {
    color: #2c5f8d;
    margin-bottom: 16px;
    font-size: 18px;
}

.modal-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 18px;
    outline: none;
    transition: border 0.15s;
}

.modal-box input:focus {
    border-color: #4a90d9;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 200;
    animation: fadein 0.25s;
}

@keyframes fadein {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
