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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.navbar {
    background: #2c3e50;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.nav-brand a {
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: #fff;
}

.nav-user {
    color: #3498db;
    font-weight: 500;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-group small {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.form-card {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 600px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.inline-form {
    display: inline;
}

.inline-form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.site-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.site-card h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.site-card h3 a:hover {
    color: #3498db;
}

.site-desc {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.site-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #95a5a6;
    margin: 1rem 0;
}

.site-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.site-header {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.site-header-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.upload-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.upload-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: #f8f9fa;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    font-size: 0.9rem;
}

.tab-btn.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.tab-content {
    display: none;
    padding: 1rem 0;
}

.tab-content.active {
    display: block;
}

.upload-form {
    max-width: 500px;
}

.file-list-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
}

.file-table, .table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.file-table th, .file-table td,
.table th, .table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.file-table th, .table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
}

.card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.preview-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
}

.preview-frame {
    width: 100%;
    height: 70vh;
    border: none;
}

.text-muted {
    color: #95a5a6;
    font-size: 0.85rem;
}

code {
    background: #f1f2f6;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

h1 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

h2 {
    margin-bottom: 1rem;
    color: #34495e;
    font-size: 1.1rem;
}

.site-stats {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
}

.stat {
    font-size: 0.85rem;
    color: #7f8c8d;
    background: #ecf0f1;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.file-tree {
    margin-top: 1rem;
}

.tree-root {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tree-root ul {
    list-style: none;
    padding-left: 1.5rem;
    margin: 0;
    border-left: 1px solid #e0e0e0;
}

.tree-item {
    margin: 0;
    padding: 0;
}

.tree-node {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.tree-node:hover {
    background: #f0f4f8;
}

.tree-node-dir {
    background: #f8f9fa;
    font-weight: 500;
}

.tree-node-dir:hover {
    background: #e8ecf0;
}

.tree-node-file {
    border-bottom: 1px solid #f5f5f5;
}

.tree-toggle {
    cursor: pointer;
    width: 16px;
    font-size: 0.7rem;
    color: #95a5a6;
    user-select: none;
    flex-shrink: 0;
}

.tree-toggle:hover {
    color: #3498db;
}

.tree-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.tree-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-count {
    font-size: 0.75rem;
    color: #95a5a6;
    flex-shrink: 0;
}

.tree-size {
    font-size: 0.8rem;
    color: #95a5a6;
    flex-shrink: 0;
    min-width: 60px;
    text-align: right;
}

.tree-time {
    font-size: 0.75rem;
    color: #bdc3c7;
    flex-shrink: 0;
    min-width: 140px;
    text-align: right;
}

.tree-action {
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.tree-node:hover .tree-action {
    opacity: 1;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #95a5a6;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}
