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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

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

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.nav {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 4px;
    transition: background 0.3s;
    font-size: 14px;
}

.nav a:hover, .nav a.active {
    background: rgba(255,255,255,0.2);
}

.main-content {
    padding: 20px 0;
    min-height: calc(100vh - 200px);
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    width: auto;
}

.alert {
    padding: 14px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

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

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

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.table tr:hover {
    background: #f8f9fa;
}

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

.tag-success {
    background: #d4edda;
    color: #155724;
}

.tag-warning {
    background: #fff3cd;
    color: #856404;
}

.tag-danger {
    background: #f8d7da;
    color: #721c24;
}

.tag-info {
    background: #d1ecf1;
    color: #0c5460;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    text-align: center;
    padding: 20px;
}

.stat-card .number {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
}

.stat-card .label {
    color: #777;
    margin-top: 8px;
    font-size: 14px;
}

.login-container {
    max-width: 400px;
    margin: 60px auto;
    padding: 0 20px;
}

.footer {
    text-align: center;
    padding: 24px 0;
    color: #777;
    font-size: 13px;
}

.search-box {
    position: relative;
    margin-bottom: 10px;
}

.search-box input {
    padding-left: 36px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.anchor-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    -webkit-overflow-scrolling: touch;
}

.anchor-item {
    padding: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.anchor-item:last-child {
    border-bottom: none;
}

.anchor-item:hover {
    background: #f8f9fa;
}

.anchor-item.selected {
    background: #e8f0fe;
}

.anchor-checkbox {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.selected-anchors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.selected-anchor {
    background: #667eea;
    color: white;
    padding: 6px 14px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.selected-anchor .remove {
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
}

.batch-input-wrapper {
    display: flex;
    gap: 10px;
}

.batch-input-wrapper .form-control {
    flex: 1;
}

.batch-input-wrapper .btn {
    white-space: nowrap;
}

.admin-sidebar {
    background: #2c3e50;
    color: white;
    min-height: calc(100vh - 120px);
    padding: 20px 0;
}

.admin-sidebar a {
    display: block;
    color: #ecf0f1;
    padding: 12px 20px;
    text-decoration: none;
    transition: background 0.3s;
}

.admin-sidebar a:hover, .admin-sidebar a.active {
    background: #34495e;
}

.admin-content {
    padding: 20px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
}

.notification-item {
    padding: 14px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.notification-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.notification-item.unread {
    background: #e8f0fe;
    border-left: 3px solid #667eea;
}

.notification-title {
    font-weight: 500;
    margin-bottom: 6px;
}

.notification-content {
    color: #555;
    margin-bottom: 6px;
    font-size: 14px;
}

.notification-time {
    color: #777;
    font-size: 12px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    .header {
        padding: 16px 0;
    }
    
    .header h1 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .nav {
        gap: 8px;
    }
    
    .nav a {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .main-content {
        padding: 16px 0;
    }
    
    .card {
        padding: 16px;
        border-radius: 6px;
    }
    
    .card h2 {
        font-size: 16px;
        margin-bottom: 14px;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .number {
        font-size: 28px;
    }
    
    .stat-card .label {
        font-size: 13px;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        min-height: auto;
    }
    
    .btn {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .table-container {
        margin: 0 -4px;
        padding: 0 4px;
    }
    
    .table th, .table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .anchor-item {
        padding: 14px 12px;
    }
    
    .selected-anchor {
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 16px;
    }
    
    .nav {
        justify-content: center;
    }
    
    .nav a {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .card {
        padding: 14px;
    }
    
    .stat-card .number {
        font-size: 24px;
    }
    
    .form-control {
        padding: 14px;
        font-size: 16px;
    }
    
    .btn {
        padding: 16px;
        font-size: 16px;
    }
}
