* { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; }

html, body { 
    height: 100%; 
    overflow: hidden;
    margin: 0;
    padding: 0;
}

body { background: #f5f7fa; }

input, select, textarea { autocomplete: off; }

.loading-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    padding: 50px 40px;
    width: 420px;
}

.login-logo {
    text-align: center;
    margin-bottom: 35px;
}

.login-logo .icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.login-logo h1 {
    font-size: 26px;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.login-btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    font-size: 16px !important;
    border-radius: 8px !important;
    transition: all 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.main-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 200px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar-header span {
    font-size: 16px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 14px 25px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(102, 126, 234, 0.15);
    color: #fff;
    border-left-color: #667eea;
}

.sidebar-nav a .nav-icon {
    margin-right: 12px;
    font-size: 18px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.header {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.tabs-container {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
}

.tabs-container::-webkit-scrollbar { display: none; }

.tab-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background: #f5f7fa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-item:hover { background: #e8ecf1; }

.tab-item.active {
    background: #667eea;
    color: #fff;
}

.tab-item .tab-close {
    margin-left: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.tab-item .tab-close:hover { background: rgba(0,0,0,0.1); }

.tab-item.active .tab-close:hover { background: rgba(255,255,255,0.2); }

.header-right {
    display: flex;
    align-items: center;
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.user-info:hover { background: #f5f7fa; }

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    color: #333;
}

.user-info .arrow {
    font-size: 10px;
    color: #999;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 8px 0;
    min-width: 150px;
    z-index: 1000;
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu a:hover {
    background: #f5f7fa;
    color: #667eea;
}

.user-menu a.danger:hover {
    background: #fef2f2;
    color: #ef4444;
}

.menu-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 8px 0;
}

.content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #f5f7fa;
}

.layui-layer { border-radius: 12px !important; overflow: hidden; }

.layui-layer-title {
    background: #fff !important;
    border-bottom: 1px solid #f0f0f0 !important;
    font-weight: 600 !important;
    color: #333 !important;
}

.password-field {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    cursor: pointer;
}

.password-field:hover { color: #667eea; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { 
    animation: fadeIn 0.3s ease-out; 
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.input-clear-wrapper {
    position: relative;
    display: inline-block;
}

.input-clear-wrapper .layui-input {
    padding-right: 30px;
}

.input-clear-wrapper .clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ccc;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    transition: background 0.2s, opacity 0.2s;
}

.input-clear-wrapper .clear-btn:hover {
    background: #999;
}

.input-clear-wrapper .clear-btn::before {
    content: '×';
    font-weight: bold;
}

.input-clear-wrapper .clear-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.layui-btn-primary {
    border-color: #667eea;
    color: #667eea;
}

.layui-btn-primary:hover {
    background: #667eea;
    color: #fff;
}

.layui-btn-normal { background: #667eea; }

.layui-btn-danger { background: #ef4444; }

.layui-btn-query {
    background: #10b981;
    border-color: #10b981;
}

.layui-btn-query:hover {
    background: #059669;
    border-color: #059669;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.tag-blue { background: rgba(102, 126, 234, 0.1); color: #667eea; }
.tag-green { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.tag-orange { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.tag-red { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.tag-cyan { background: rgba(6, 182, 212, 0.1); color: #06b6d4; }

.layui-form-select .layui-edge {
    display: block !important;
    border-top-color: #666 !important;
}

.layui-form-select dl { top: 38px; }

.layui-form-radio {
    display: inline-flex !important;
    align-items: center;
    padding: 4px 10px;
    margin: 0 !important;
    border-radius: 12px;
    background: #f5f7fa;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.layui-form-radio:hover {
    background: #e8ecf1;
}

.layui-form-radio.layui-form-radioed {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.layui-form-radio > i {
    display: none !important;
}

.layui-form-radio > div {
    padding: 0 !important;
    font-size: 12px;
}

.layui-form-radio.layui-form-radioed > div {
    color: #fff !important;
}

.layui-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px !important;
    cursor: pointer;
}

select option {
    color: #333;
    background: #fff;
}

.filter-bar {
    background: #fff;
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    flex-shrink: 0;
}

.filter-bar .layui-input,
.filter-bar .layui-select { border-radius: 6px; }

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

.filter-bar .layui-col-md3 {
    width: auto;
    min-width: 180px;
}

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

.content-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.content-card .card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.content-card .card-header h3 {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    margin: 0;
}

.content-card .card-body { 
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.layui-table-view {
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.layui-table-view .layui-table-header { background: #fafafa; }

.layui-table-view .layui-table th {
    background: transparent;
    font-weight: 500;
    color: #666;
    text-align: center !important;
}

.layui-table-view .layui-table td { 
    border-color: #f0f0f0; 
    text-align: center !important;
}

.layui-table-view .layui-table tr:hover { background: #fafbfc; }

.layui-table th {
    text-align: center !important;
}

.page-header {
    margin-bottom: 25px;
    flex-shrink: 0;
}

.page-header h2 {
    font-size: 24px;
    color: #333;
    font-weight: 600;
    margin: 0;
}

.page-header p {
    color: #999;
    font-size: 14px;
    margin-top: 5px;
}

.stat-cards { 
    margin-bottom: 25px; 
    flex-shrink: 0;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card.blue::before { background: linear-gradient(90deg, #667eea, #764ba2); }
.stat-card.green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card.orange::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card.cyan::before { background: linear-gradient(90deg, #06b6d4, #22d3ee); }

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.stat-card.blue .stat-icon { background: rgba(102, 126, 234, 0.1); }
.stat-card.green .stat-icon { background: rgba(16, 185, 129, 0.1); }
.stat-card.orange .stat-icon { background: rgba(245, 158, 11, 0.1); }
.stat-card.cyan .stat-icon { background: rgba(6, 182, 212, 0.1); }

.stat-card .stat-info { margin-left: 15px; }

.stat-card .stat-info h3 {
    font-size: 28px;
    color: #333;
    font-weight: 600;
    margin: 0;
}

.stat-card .stat-info p {
    color: #999;
    font-size: 14px;
    margin-top: 5px;
}

.file-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 20px; 
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.file-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transition: all 0.3s;
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.file-card .file-preview {
    height: 160px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-card .file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.file-card:hover .file-preview img { transform: scale(1.05); }

.file-card .file-preview .file-icon { font-size: 48px; color: #ccc; }

.file-card .file-info { padding: 15px; }

.file-card .file-info h4 {
    font-size: 14px;
    color: #333;
    margin: 0 0 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-card .file-info p {
    font-size: 12px;
    color: #999;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-card .file-actions {
    padding: 10px 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    flex-shrink: 0;
}

.empty-state .icon { font-size: 64px; margin-bottom: 15px; opacity: 0.5; }

.empty-state p { font-size: 15px; }

.layui-form-label { width: 80px; }
.layui-input-block { margin-left: 110px; }

.table-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    min-height: 0;
}

.table-wrapper .layui-table {
    width: auto !important;
    min-width: 100% !important;
    background: #fff !important;
}

.table-wrapper .layui-table th,
.table-wrapper .layui-table td {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    color: #333 !important;
    padding: 10px 15px !important;
}

.table-wrapper .layui-table th {
    background: #fafafa !important;
    font-weight: 500;
    color: #666 !important;
}

.table-wrapper .layui-table td {
    color: #666 !important;
}

.table-wrapper .layui-table tbody tr {
    background: #fff !important;
}

.table-wrapper .layui-table tbody tr:hover {
    background: #f5f7fa !important;
}

.pagination-wrapper {
    padding: 10px 20px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-btns {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination-btns .layui-btn {
    min-width: 32px;
    height: 32px;
    line-height: 32px;
    padding: 0 10px;
    font-size: 13px;
}

.pagination-btns .layui-btn.active {
    background: #667eea;
    color: #fff;
}

.page-size-select {
    padding: 5px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}
