* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', Arial, sans-serif;
}

body {
    background: #f3f4f6;
    color: #1f2a44;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-container, .logout-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 20px;
    background: linear-gradient(135deg, #93c5fd, #dbe4ff);
}

.login-box, .logout-box {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 450px;
    text-align: center;
    animation: slideUp 0.5s ease;
}

.login-header {
    margin-bottom: 30px;
}

.login-box h1, .logout-box h1 {
    font-size: 32px;
    color: #1e40af;
    margin-bottom: 10px;
    font-weight: 600;
}

.login-box p, .logout-box p {
    font-size: 16px;
    color: #6b7280;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 8px rgba(30,64,175,0.2);
}

.btn-primary {
    padding: 14px;
    background: linear-gradient(90deg, #1e40af, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    width: 100%; /* 默认全宽 */
}

.inline-form .btn-primary {
    width: 150px; /* 固定宽度，与“添加IP段”一致 */
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #1e3a8a, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30,64,175,0.3);
}

.btn-secondary {
    display: inline-block;
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    background: #e5e7eb;
    color: #374151;
    text-decoration: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s, transform 0.2s;
}

.btn-secondary:hover {
    background: #d1d5db;
    transform: translateY(-2px);
}

.btn-danger {
    padding: 8px 15px;
    background: linear-gradient(90deg, #dc2626, #f87171);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn-danger:hover {
    background: linear-gradient(90deg, #b91c1c, #ef4444);
    transform: translateY(-2px);
}

.btn-edit {
    padding: 8px 15px;
    background: linear-gradient(90deg, #eab308, #facc15);
    color: #1f2a44;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn-edit:hover {
    background: linear-gradient(90deg, #ca8a04, #eab308);
    transform: translateY(-2px);
}

.error {
    color: #dc2626;
    font-size: 14px;
    margin-top: 15px;
    background: #fee2e2;
    padding: 10px;
    border-radius: 8px;
}

header {
    background: linear-gradient(90deg, #1e40af, #3b82f6);
    color: #fff;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

header nav .logout {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    transition: background 0.3s, transform 0.2s;
}

header nav .logout:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    flex-grow: 1;
}

.card {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.card h2 {
    font-size: 24px;
    color: #1e40af;
    margin-bottom: 20px;
    font-weight: 600;
}

.card h3 {
    font-size: 20px;
    color: #1e40af;
    margin: 20px 0 15px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 15px;
    color: #374151;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 8px rgba(30,64,175,0.2);
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #374151;
}

.checkbox-label input {
    width: auto;
    margin-right: 10px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.inline-form .form-group {
    flex: 1;
    min-width: 200px;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 15px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f9fafb;
    color: #1e40af;
    font-weight: 600;
}

td a {
    color: #1e40af;
    text-decoration: none;
    transition: color 0.3s;
}

td a:hover {
    color: #2563eb;
    text-decoration: underline;
}

td input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.fixed-label {
    color: #6b7280;
    font-size: 14px;
    background: #f3f4f6;
    padding: 5px 10px;
    border-radius: 6px;
}

.notification {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    font-size: 16px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.notification.success {
    background: #dcfce7;
    color: #15803d;
}

.notification.error {
    background: #fee2e2;
    color: #dc2626;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .login-box, .logout-box {
        padding: 25px;
        margin: 20px;
        max-width: 100%;
    }

    .login-box h1, .logout-box h1 {
        font-size: 26px;
    }

    .login-box p, .logout-box p {
        font-size: 14px;
    }

    header {
        padding: 15px;
    }

    .header-container {
        flex-direction: column;
        gap: 10px;
    }

    header h1 {
        font-size: 22px;
    }

    header nav .logout {
        padding: 8px 15px;
    }

    main {
        padding: 0 10px;
        margin: 20px auto;
    }

    .card {
        padding: 20px;
    }

    .card h2 {
        font-size: 20px;
    }

    .card h3 {
        font-size: 18px;
    }

    .inline-form {
        flex-direction: column;
    }

    .inline-form .form-group {
        min-width: 100%;
    }

    .inline-form .btn-primary {
        width: 100%; /* 手机端全宽 */
    }

    table, th, td {
        font-size: 14px;
    }

    th, td {
        padding: 10px;
    }

    .btn-primary, .btn-secondary, .btn-danger, .btn-edit {
        padding: 12px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .login-box, .logout-box {
        padding: 20px;
    }

    .login-box h1, .logout-box h1 {
        font-size: 22px;
    }

    .form-group input, .form-group textarea, .form-group select {
        font-size: 14px;
    }

    .card h2 {
        font-size: 18px;
    }

    .btn-primary, .btn-secondary, .btn-edit {
        font-size: 14px;
    }
}
.footer {
    text-align: center;
    padding: 20px 0;
    color: #666;
    font-size: 14px;
    margin-top: 20px;
}
